MarineSparkLM-4B: A LoRA Practice for a Lightweight Marine Engineering Language Model

MarineSparkLM-4B adapts to marine engineering on a single workstation with two LoRA fine-tunings; instruction tuning boosts scores but absolute accuracy stays limited.
MarineSparkLM-4B uses the 4B-parameter OceanGPT-basic-4B-Instruct as its base and trains two LoRA adapters on a single NVIDIA DGX Spark, each updating only 0.81% of parameters. The first adapter performs next-token prediction on a 61.6M-token marine engineering corpus, with validation loss dropping from 2.082 to 1.976 but the model still drifting off-topic; the second adapter performs instruction fine-tuning on 2,295 QA pairs with loss computed only on answer tokens, significantly improving instruction following. Human ratings on 20 held-out prompts: base 42, continuation adapter 56, instruction adapter 84, with retrieval 88, but absolute correct counts are only 14/40 and 20/40. The authors also report two negative results and evaluation limitations, stressing the model suits auxiliary use rather than authoritative knowledge.
Text in the marine and offshore engineering domain is scattered across preprints, open-access journals, encyclopedias, and institutional documents, and the total volume falls far short of the threshold for large-scale pretraining. How can one build a usable domain language model on a single workstation-class device through parameter-efficient fine-tuning? MarineSparkLM-4B offers a pragmatic answer.

Starting from OceanGPT: A Two-Stage LoRA Fine-Tuning Strategy
The research team used the 4-billion-parameter OceanGPT-basic-4B-Instruct as the base model and trained two independent LoRA adapters. Each adapter updates only 33 million of the 406 million parameters, or 0.81%, yet must shoulder the dual tasks of domain knowledge injection and instruction following. On a single NVIDIA DGX Spark, training the first adapter took 4 hours and 40 minutes, while the second took only 10 minutes, bringing the hardware barrier down to the workstation level.
The First Adapter: Continued Pretraining on Domain Corpus
The first adapter used a next-token prediction task, with a training corpus covering ten engineering topics totaling 61.6 million tokens. The corpus was built from 13,879 source documents, and after deduplication and two-stage keyword filtering (to eliminate cross-domain vocabulary collisions), 7,069 documents were retained. Over 1,500 training steps, validation loss decreased from 2.082 to 1.976. However, direct testing exposed a problem: when faced with a retrieval-augmented ballast water prompt, the model still drifted off-topic.
Next-Token Prediction is the standard pretraining objective for autoregressive language models: given a preceding token sequence, the model outputs a probability distribution over the vocabulary and maximizes the likelihood of the true next token via cross-entropy loss. In domain continued pretraining, this objective enables the model to learn the lexical collocations, syntactic patterns, and discourse structures of domain text, thereby "transferring" general language capabilities to the marine engineering context. The first adapter in this article adopts this task, training for 1,500 steps on a 61.6-million-token domain corpus, with validation loss decreasing from 2.082 to 1.976. The limited loss reduction indicates that the model adapted quickly to the corpus distribution, but it also means that continued pretraining alone struggles to teach the model to "answer according to instructions"—which is precisely why a second-stage instruction fine-tuning is needed.
The Second Adapter: Instruction Fine-Tuning for Course Correction
To address the off-topic issue, the team trained a second adapter on 2,295 question-answer pairs, of which 114 were handwritten and 2,181 were generated by the base model from corpus passages, with loss computed only on answer tokens. This design teaches the model to focus its response within a given context rather than freely continuing text.
LoRA (Low-Rank Adaptation) is a parameter-efficient fine-tuning technique. Its core idea is to freeze all original weights of the pretrained model and inject a pair of low-rank matrices A and B as a bypass into each layer (typically the linear projection layers of the attention module), decomposing the weight update ΔW into the product BA, where A has dimensions r×d and B has dimensions d×r, with rank r much smaller than the original dimension d. During training, only A and B are updated, greatly reducing the number of trainable parameters. Taking the 4-billion-parameter base model in this article as an example, a single adapter requires training only about 33 million parameters, or 0.81%. At inference time, BA can be merged back into the original weights without introducing additional latency; alternatively, the independent adapters can be retained and switched on demand. LoRA's advantages lie in low memory usage, fast training, and easy coexistence of multiple tasks, making it particularly suitable for domain adaptation on a single workstation.
Instruction Tuning refers to supervised fine-tuning of a pretrained model on "instruction-answer" paired data, so that the model learns to understand task descriptions and generate expected responses rather than freely continuing text. The key is that loss is computed only on the tokens of the answer portion (i.e., masking the instruction portion), forcing the model to focus on learning "how to answer given the context." This article uses 2,295 question-answer pairs (114 handwritten, 2,181 generated by the base model from corpus passages) to train the LoRA adapter. This stage significantly improved topic relevance and instruction-following ability, with human ratings jumping from 56 for the continuation adapter to 84. However, the small-scale QA data also brings overfitting risk, as evidenced by the authors' report of "overfitting within 100 steps."
Evaluation Results: Instruction Fine-Tuning Brings Substantial Improvement
On 20 held-out prompts, human raters scored on three dimensions—accuracy, topic relevance, and specificity (maximum 120 points). The results for the four configurations were: base model only 42 points, continuation adapter 56 points, instruction adapter 84 points, and instruction adapter plus retrieval 88 points. The jump from instruction fine-tuning was the most pronounced, while retrieval augmentation provided an additional but limited gain.
Absolute accuracy remains low: without retrieval, 14 of 40 questions were answered correctly; with retrieval, 20 were correct. This indicates that lightweight domain models still have clear shortcomings in factual question answering and are better suited as auxiliary tools rather than authoritative knowledge sources.
Retrieval-Augmented Generation (RAG) refers to retrieving document passages relevant to the question from an external knowledge base before the model generates an answer, splicing them into the prompt context, and having the model answer based on the retrieved evidence. RAG can alleviate the problem of insufficient factual knowledge in model parameters and improve the traceability of answers. The "instruction adapter plus retrieval" configuration in this article injects retrieved ballast water-related passages into the prompt, raising the score from 84 to 88 and increasing the number of correct answers from 14/40 to 20/40. However, the limited gain indicates that retrieval can only provide contextual clues, and the model's own reasoning and fact-verification capabilities remain the bottleneck; if retrieval quality is poor or the model ignores the evidence, RAG's effectiveness will be diminished.
Two Negative Results and Evaluation Limitations
The authors honestly reported two negative results: a keyword filtering fix that was rolled back, and an instruction training run that overfitted within 100 steps. The latter suggests that more cautious early-stopping strategies are needed with small-scale QA data.
The evaluation itself also has limitations: only a small-scale prompt set was used, inter-rater agreement was not measured, and reference answers were generated by the model. These factors may affect the reliability of the scores, and readers should be cautious when interpreting the gap between 84 and 88.
Implications for Lightweight Domain Models
The value of MarineSparkLM-4B lies not in topping leaderboards but in demonstrating a reproducible path: completing domain adaptation on a single workstation with an extremely low proportion of parameter updates. For vertical domains like marine engineering where text is scarce and annotation is expensive, the two-stage strategy—domain continuation first, then instruction alignment—is more effective than a single fine-tuning. At the same time, although retrieval augmentation can improve topic relevance, it cannot fundamentally solve the problem of insufficient accuracy; future work may need to incorporate higher-quality domain QA data or retrieval verification mechanisms.
One-line Summary
MarineSparkLM-4B completes marine engineering domain adaptation on a single workstation with two LoRA fine-tunings; instruction fine-tuning greatly improves scores but absolute accuracy remains limited.
Paragraph Summary
MarineSparkLM-4B uses the 4-billion-parameter OceanGPT-basic-4B-Instruct as its base and trains two LoRA adapters on a single NVIDIA DGX Spark, each updating only 0.81% of parameters. The first adapter performs next-token prediction on a 61.6-million-token marine engineering corpus, with validation loss decreasing from 2.082 to 1.976, but the model still drifts off-topic; the second adapter performs instruction fine-tuning on 2,295 QA pairs with loss computed only on answer tokens, significantly improving instruction-following ability. Human ratings on 20 held-out prompts show: base 42, continuation adapter 56, instruction adapter 84, plus retrieval 88, but absolute correct counts are only 14/40 and 20/40. The authors also report two negative results and evaluation limitations, emphasizing that the model is suitable as an auxiliary tool rather than an authoritative knowledge source.
Related articles

Prompt Engineering for Beginners: From Writing Prompts to Engineering Thinking
Starting from the essence and four functions of prompts, this article systematically explains the six-step process, four success criteria, learning value, and practical limitations of prompt engineering to help you build a complete understanding.

Anthropic Launches Nasdaq IPO: AI Giant's Listing and Risk Disclosures
Anthropic officially launches its Nasdaq IPO under ticker ANT, with market valuation expected to potentially exceed SpaceX's record. The prospectus devotes nearly 100 pages to AI risks, while first-half revenue grew over 14x but net losses widened sharply, reigniting the AI bubble debate.

Rust cURL Clone Uses 4,832 unsafe Blocks—Is the Memory Safety Myth Broken?
A Rust cURL clone uses 4,832 unsafe keywords, challenging Rust's memory safety narrative. We analyze what unsafe really means, compare Fil-C, and examine rewrite motives.