OceanCoder: A Verification-Guided Large Language Model for Automated Simulation Modelling in Ocean Engineering
Organizations: College of Engineering, Ocean University of China, Qingdao, 266100, China · School of Mechanical Engineering and Automation, Beihang University, Beijing, 102206, China
Abstract
Numerical simulation is important in ocean engineering, but model construction requires expert knowledge. Large language models support automated modelling, but code syntax and successful execution alone do not establish whether generated models and results meet engineering requirements. We present OceanCoder, a Qwen3-8B-based large language model for automated simulation modelling in ocean engineering. To address specialised programming requirements and scarce training data, we develop an extensible data construction pipeline producing 12,000 verified supervised fine-tuning (SFT) examples across 12 engineering task categories. A three-layer verification framework checks model inputs against engineering parameters and task constraints, verifies completion of required simulation analyses, and assesses the engineering plausibility of computed outputs. Its outcomes provide graded rewards for group relative policy optimisation (GRPO), guiding the model towards engineering task completion. We also construct the first benchmark for automated modelling in ocean engineering, covering out-of-distribution tasks and real-world engineering cases. Experiments and ablation studies demonstrate the effectiveness of the data pipeline, verification framework and reward design. OceanCoder outperforms both base models and the closed-source comparison, with Pass@1 increasing from 0% for the base model to 46.77% after SFT and 51.43% after GRPO. These results support engineering verification as a training signal for automated simulation modelling.
Figures & tables
| Group | ID | Engineering task |
| Static | A1 | Single-catenary static equilibrium |
| analysis | A2 | Four-point mooring static equilibrium |
| A3 | SCR static configuration and touchdown | |
| A4 | Pipeline lateral stability | |
| Dynamic | B1 | Single catenary under regular waves |
| response | B2 | Coupled four-point mooring dynamics |
| Input group | Parameter (unit) | Corpus range | Engineering scope and coupling constraints |
| Geometry | Water depth, ( ) | 15–1,975 | Shallow-to-intermediate pipelines, moorings and installation tasks (15–380 m); deepwater steel catenary risers (450–1,975 m). |
| Total line / pipeline length, ( ) | 45–3,015 | Scaled with water depth and hang-off geometry across lifting slings (45–75 m), catenary moorings and pipelay (130–1,031 m) and deepwater SCRs (920–3,015 m). | |
| Structure | Outer / nominal diameter, ( ) | 44–610 | Coupled within component property packages: hoisting wires and subsea cables (44–160 mm), mooring chains and ropes (70–360 mm) and offshore steel pipelines/risers (219.1–610 mm). |
| Bare unit mass, ( ) | 6.5–366.2 | Bare structural mass across cables (6.5–60 kg/m), mooring lines (52–286.6 kg/m) and bare steel pipes (70.8–366.2 kg/m); in coated pipeline stability tasks (A4), adding concrete weight coating yields total coated mass of 109.7–1,393.7 kg/m. | |
| Axial stiffness, ( ) | 60–10,049 | Assigned by structural member type to preserve realistic axial elongation across slings and cables (60–400 MN), mooring lines (82–1,674 MN) and thick-walled steel pipes (1,894–10,049 MN). | |
| Environment | Wave height, / ( ) | 0–8.0 | Still water (0 m) in static equilibrium and controlled lowering analyses; regular waves (1.08–8.0 m) and irregular JONSWAP seas ( –3.30 m) in dynamic tasks. |
| Component | Original seed: A1, seed_01 | Expanded pair: A1_seed_01_v001 |
| Task | Construct one catenary, solve static equilibrium, save the model and extract the specified responses. | The same task family and analysis and output requirements, with expanded physical inputs. |
| Geometry | Water depth 80 m; fixed A at m; anchored B at m and zero height above the seabed; line length 145 m. | Water depth 100 m; fixed A at m; anchored B at m and zero height above the seabed; line length 200 m. |
| Line properties | Equivalent outer diameter 90 mm; mass 95 kg/m; axial stiffness 800 MN. | Equivalent outer diameter 160.7 mm; mass 158.2 kg/m; axial stiffness 729.7 MN. |
| Contact and mesh | Default contact diameter (inherited from outer diameter) and standard axial compression; target segment length 2 m. | Parameterized contact diameter (306.0 mm) and compression-limit switch activated within the seed’s admissible parameter space; target segment length 2 m. |
| Common conditions | Still water, zero current, flat elastic seabed and normal stiffness . Unspecified inputs retain the stated empty-model defaults. | |
| Program excerpts | model.environment.WaterDepth = 80.0 line.Length = (145.000,) model.CalculateStatics() | model.environment.WaterDepth = 100.0 line.Length = (200.0,) model.CalculateStatics() |
| Reward | Established outcome |
| 0 | Format, syntax or static safety checks fail. |
| 0.1 | Code checks pass, but execution, file delivery or model reloading fails. |
| 0.4 | Execution, delivery and reloading pass, but engineering acceptance is incomplete. |
| 1 | All applicable engineering acceptance checks pass. |
| Symbol | Meaning |
| Token of candidate program . | |
| Prompt and preceding tokens of that candidate. | |
| , | Current and sampling policies, respectively. |
| Fixed SFT reference policy. | |
| , | Candidate reward and group-centred advantage. |
| , | Unclipped and clipped probability ratios. |
| Task stratum | Tasks | Share (%) |
| Core parameter variation | 352 | 52.93 |
| Structural variation | 237 | 35.64 |
| Engineering context | 76 | 11.43 |
| Total | 665 | 100.00 |
| Source class | Tasks | Examples of source context | Relation to the evaluated task |
| Official examples, documentation, validation or user material | 58 | Moorings, production risers, deployment, contact and line feeding. | Scenario and modelling-procedure basis, formulated with explicit task parameters and required outputs. |
| Published offshore engineering projects | 18 | Fensfjorden, Browse trunkline, Veja Mate, Baltic Sea inter-array cables and Project Natick. | Self-contained simulation specifications adapted from published offshore project descriptions and operating conditions. |
| Total | 76 | Source-card and case mappings in Appendix E . | Native simulation references and task-specific acceptance checks. |
| Setting | Stage I: SFT | Stage II: GRPO |
| Initial model | Qwen3-8B | SFT (update 2,250) |
| Training data | 12,000 pairs (12 cats.) | 150 requirements |
| Schedule | 5 epochs (3,750 steps) | 3 epochs (57 steps) |
| Learning rate | ||
| Batching | 1/GPU, grad. accum. 16 | 8 prompts/batch |
| Sampling | – | , , |
| Model | ESR (%) | Pass@1 (%) |
| Qwen3-8B | 0.00 | 0.00 |
| Qwen3-235B | 0.00 | 0.00 |
| ChatGPT-6 Sol | ||
| OceanCoder-SFT | ||
| OceanCoder-GRPO-Binary | ||
| OceanCoder-GRPO |
| Verification criterion | FA | FR | Agree. (%) |
| Execution checks only | 22 | 0 | 78.00 |
| Execution and model-input checks | 6 | 0 | 94.00 |
| Unnormalised raw output comparison | 0 | 13 | 87.00 |
| Full three-layer verifier | 0 | 0 | 100.00 |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Resource | Records | Character lengths (mean; median; range) |
| SFT requirements | 12,000 | 530.95; 530; 321–804 |
| SFT programs | 12,000 | 9,608.77; 9,101; 2,420–20,976 |
| GRPO requirements | 150 | 512.90; 502; 395–717 |
| Cat. | Primary physical and numerical verification checks |
| A1 | Single-catenary static equilibrium, line-property and boundary coordinates, end tensions, minimum elevation and maximum curvature. |
| A2 | Multi-line mooring equilibrium, fairlead/anchor layout, segment properties and directional offset restoring forces. |
| A3 | Deepwater SCR static profile, hang-off and touchdown zone (TDZ) arc lengths, bending moments and effective tensions. |
| A4 | Pipeline lateral stability across stable and breakout regimes, hydrodynamic/coating parameters and lateral displacement. |
| B1 | Regular-wave catenary dynamics, build-up/steady-cycle window alignment, peak tension and dynamic excursion. |
| B2 | Coupled four-point mooring dynamics under waves and current, floater trajectory and fairlead tension envelopes. |
| Epoch | Mean | Full (%) | Part. (%) | ||||
| 1 | 1 | 17 | 139 | 427 | 0.8293 | 73.12 | 26.71 |
| 2 | 1 | 7 | 116 | 460 | 0.8683 | 78.77 | 21.06 |
| 3 | 0 | 3 | 108 | 473 | 0.8844 | 80.99 | 19.01 |
| Total | 2 | 27 | 363 | 1360 | 0.8607 | 77.63 | 22.26 |
| Recorded label | Candidates | % |
| Model settings | 250 | 68.87 |
| Analysis process | 3 | 0.83 |
| Engineering conditions | 0 | 0.00 |
| Result/report consistency | 108 | 29.75 |
| Unclassified numerical difference | 2 | 0.55 |
| Core | Structural | Engineering | |||||||
| Cat. | SFT | GRPO | SFT | GRPO | SFT | GRPO | |||
| A1 | 28 | 25 | 27 | 20 | 0 | 0 | 10 | 0 | 0 |
| A2 | 30 | 10 | 14 | 20 | 0 | 0 | 11 | 0 | 0 |
| A3 | 30 | 18 | 27 | 20 | 0 | 0 | 10 | 1 | 3 |
| A4 | 30 | 27 | 27 | 17 | 9 | 9 | – | – | – |
| B1 | 30 | 26 | 26 | 20 | 0 | 0 | 8 | 0 | 0 |
| Stratum | Policy | Syn. | Code | Exec. | Del. | Pass | |
| All | SFT | 665 | 618 | 618 | 463 | 460 | 313 |
| GRPO | 665 | 622 | 610 | 471 | 471 | 344 | |
| Core | SFT | 352 | 348 | 348 | 335 | 334 | 286 |
| GRPO | 352 | 347 | 347 | 344 | 344 | 314 | |
| Structural | SFT | 237 | 209 | 209 | 126 | 125 | 26 |
| GRPO | 237 | 211 | 203 | 123 | 123 | 27 |
| ID | Source title | Tasks | Public URL |
| G03 | Line contact – modelling | 1 | https://www.orcina.com/webhelp/OrcaFlex/Content/html/Linecontact%2CModelling.htm |
| G04 | Modelling line feeding | 1 | https://www.orcina.com/webhelp/OrcaFlex/Content/html/Modellinglinefeeding.htm |
| G11 | C06 CALM buoy | 2 | https://www.orcina.com/wp-content/uploads/examples/c/c06/C06%20CALM%20buoy.pdf |
| G15 | Production riser examples | 1 | https://www.orcina.com/Resources/examples/ |
| G16 | Mooring examples | 2 | https://www.orcina.com/resources/examples/?key=c |
| G26 | Line results – contact and clearance | 2 | https://www.orcina.com/webhelp/OrcaFlex/Content/html/Lineresults%2CContact.htm |
| Case ID | Source IDs | Case ID | Source IDs | Case ID | Source IDs |
| RE2-001 | S03, S07 | RE2-027 | G11 | RE2-053 | S13, S24 |
| RE2-002 | S03 | RE2-028 | G11, G30 | RE2-054 | S13 |
| RE2-003 | S03 | RE2-029 | G15 | RE2-055 | S13 |
| RE2-004 | S03 | RE2-030 | G03, G26 | RE2-056 | S13 |
| RE2-005 | S03, S07 | RE2-031 | G16 | RE2-057 | S13 |
| RE2-006 | S03 | RE2-032 | G04 | RE2-058 | S13, S24 |
| Seed | Physical specification and requested analysis |
| A1 seed_01 | Water depth 80 m; ends and m; length 145 m; mm; kg/m; MN; 2 m segments. Still-water statics: end tensions, minimum elevation and maximum curvature with arc lengths. |
| B1 seed_01 | Water depth 80 m; 145 m chain ( mm); regular wave ( m, s, ); friction 0.50. Dynamic simulation (1 build-up + 15 steady periods): peak top tension and maximum horizontal excursion. |
| C4 seed_02 | Water depth 80 m; m payload (65 t, 24 m 3 ); two slings (2.5 m spacing); 3 s hover + 2 m payout at 0.06 m/s ( s); seabed stiffness 1,000/300 kN/m 3 . Outputs: first-contact time, peak force, penetration and line tensions. |
| Case | Quantity | Ref. | SFT | GRPO |
| RE2-018 | Top tension (kN) | 2,173.42 | — | 2,173.42 |
| A2-B06 | Force at (kN) | — | ||
| Force at (kN) | — | |||
| Force at (kN) | — | |||
| Force at (kN) | — | |||
| C4-039 | First contact (s) | 36.0126 | 35.0825 | 36.0126 |