Post-Training: Bringing LLMs into Specialized Scenarios Like Finance and 3D Modeling
Pre-trained large language models excel at general language tasks but fall short in specialized domains such as finance and 3D modeling, where imprecise domain knowledge, misaligned multi-source information, and unverifiable outputs limit their usefulness. This article explains how post-training techniques—including supervised fine-tuning, preference optimization, and multi-task reinforcement learning with automated reward functions—can close that gap. It covers practical implementations for cross-document financial verification, auditable financial modeling, traceable research outputs, hallucination measurement and mitigation, and code-driven 3D geometry generation, along with engineering guidance on evaluation, risk control, and cost-benefit assessment for production deployment.
1. Background: The Gap Between Foundation Models and Specialized Scenarios
The pre-training phase of large language models primarily addresses general language understanding and generation. Models learn grammar, common sense, and basic reasoning from massive text corpora, but they still encounter three typical problems in specialized scenarios.
First, domain knowledge lacks precision. Accounting standards in financial statements, detailed rules in financial reporting, and annotation conventions in engineering drawings occupy a small fraction of general-purpose training data. As a result, models tend to produce answers that sound plausible but are factually wrong.
Second, multi-source information is hard to align. A single financial analysis often requires reading an annual report, its footnote tables, quarterly announcements, and internal calculation sheets at the same time. The model must locate the corresponding entries for the same metric across multiple files and determine whether the values are consistent.
Third, outputs lack verifiability. Professional users need to know where each conclusion comes from. If a model only delivers conclusions without sources, reviewers still have to check the original materials line by line, and the labor cost is never truly reduced.
The architecture of foundation models typically remains unchanged; the focus of improvement shifts to post-training. Post-training refers broadly to all capability-shaping steps after pre-training, including supervised fine-tuning, preference optimization, and reinforcement learning. Its core purpose is to align model behavior with the objectives of specific tasks.
2. Key Post-Training Techniques
2.1 Supervised Fine-Tuning
Supervised fine-tuning trains the model on paired samples of inputs and ideal outputs. For example, given multiple financial documents, annotators write the correct verification conclusions, and the model learns this input-output mapping. Data quality sets the ceiling, so specialized scenarios usually require domain experts to participate in annotation and review.
2.2 Preference Optimization
Preference optimization teaches the model which answer is better. Multiple candidate answers are generated for the same question and ranked by human reviewers or rule-based systems, and the model adjusts its output distribution accordingly. In specialized scenarios, ranking criteria should include factual correctness, citation completeness, and conciseness—not just fluency.
2.3 Multi-Task Training with Reinforcement Learning
Reinforcement learning guides model behavior through reward signals. When a task in a specialized domain can be automatically judged as right or wrong—for example, whether reconciled values match, whether code passes unit tests, or whether a modeling file imports successfully—a reward function can be designed so the model repeatedly attempts tasks and receives feedback at scale.
Tasks from multiple downstream domains can be trained jointly in a single pipeline. The advantage is that common capabilities across domains—such as structured reasoning, long-document retrieval, and strict format compliance—can transfer between them. Below is a simplified reward function example:
def compute_reward(task_type, output, ground_truth):"""Compute the reward based on task type; score ranges from 0 to 1."""if task_type == "financial_check":# Value consistency: each metric scores if its deviation from the ground truth is within tolerancematched = sum(1 for k, v in output["metrics"].items()if k in ground_truth and abs(v - ground_truth[k]) <= 0.01)total = max(len(ground_truth), 1)score = matched / total# Citation completeness: every finding must include a sourcecited = all(item.get("source_id") for item in output["findings"])return score * (1.0 if cited else 0.5)if task_type == "model_generation":# Whether the generated modeling script executes and passes the size checkreturn 1.0 if output.get("executed") and output.get("size_ok") else 0.0return 0.0
The principle illustrated here is that rewards must be automatically computable and must cover both correctness and process compliance. If only the final result is judged, the model may learn to exploit loopholes, such as fabricating plausible-looking numbers. Adding citation checks forces the model to provide evidence alongside its conclusions.
3. The Finance Scenario: Cross-Document Verification, Financial Modeling, and Traceable Research
Financial workflows demand high accuracy and explicit process transparency. For this scenario, post-training typically focuses on three directions.
3.1 Cross-Document Verification
The goal of cross-document verification is to confirm whether the same metric is consistent across different files. A typical workflow includes the following steps:
- Extract the metric name, value, unit, and reporting period from each file.
- Normalize the measurement basis—for example, converting “ten thousand yuan” and “yuan” to the same unit, and mapping “current period” and “reporting period” to the same time range.
- Compare values and flag records that exceed the tolerance threshold as anomalies.
- Provide possible causes for anomalies, such as differences in measurement basis, correction announcements, or data entry errors.
The model handles extraction, alignment, and explanation in this workflow, while final judgment remains with humans. During training, annotated data should include real measurement-basis traps—such as the difference between consolidated statements and parent-company statements—otherwise the model only learns surface-level matching.
Below is a simplified implementation of value verification:
from dataclasses import dataclass@dataclassclass Record:metric: strvalue: floatunit: strperiod: strsource_id: strUNIT_SCALE = {"yuan": 1.0, "ten_thousand_yuan": 1e4, "hundred_million_yuan": 1e8}def normalize(rec: Record) -> float:return rec.value * UNIT_SCALE[rec.unit]def cross_check(records: list[Record], tolerance: float = 0.005):"""Group records by metric and period, then check whether values from different sources agree within tolerance."""groups: dict[tuple, list[Record]] = {}for r in records:groups.setdefault((r.metric, r.period), []).append(r)anomalies = []for key, items in groups.items():if len(items) < 2:continuebase = normalize(items[0])for other in items[1:]:val = normalize(other)if base and abs(val - base) / abs(base) > tolerance:anomalies.append({"key": key, "sources": [items[0].source_id, other.source_id]})return anomalies
3.2 Financial Modeling
Financial modeling requires explicit assumptions and auditable formulas. The modeling process generated by the model should list key assumptions—such as growth rates, discount rates, and tax rates—and state the source of each assumption. Calculations should use traceable formulas rather than presenting results directly.
Training data can include samples in an “assumption checklist” format. Once the output structure is fixed, reviewers can quickly check whether each parameter is reasonable and re-run calculations when parameters change.
3.3 Traceable Research
Traceable research requires that every conclusion can be traced back to the original passage. This is typically implemented by binding evidence identifiers to the output and checking in post-processing whether those identifiers actually exist in the retrieval results.
This mechanism cannot replace the model’s inherent accuracy, but it turns hidden errors into visible ones. A conclusion without corresponding evidence is flagged directly, allowing reviewers to focus their attention on those entries.
4. Hallucination Rate: Definition, Measurement, and Mitigation
Hallucination refers to model output that contradicts facts or the input materials. In specialized scenarios, hallucinations fall into three categories: fabricated data, misattributed citations, and unjustifiably inferred conclusions.
4.1 Measurement Methods
Measuring hallucination rate first requires defining what counts as “supported.” A common approach is to break model output into atomic claims and check each claim for verifiable supporting evidence.
def hallucination_rate(claims: list[dict], evidence_index: set[str]) -> float:"""claims: each claim contains text and source_ids fields.evidence_index: the set of all valid evidence identifiers returned by the retrieval system."""if not claims:return 0.0unsupported = 0for claim in claims:refs = claim.get("source_ids", [])# No citation, or a citation pointing to non-existent evidence, counts as unsupportedif not refs or any(ref not in evidence_index for ref in refs):unsupported += 1return unsupported / len(claims)
This measurement has two prerequisites. First, claim decomposition must be stable; otherwise the same output yields different results in the hands of different reviewers. Second, the evidence repository must cover the evaluation samples, or correct answers will be misjudged.
4.2 Engineering Approaches to Reducing Hallucination
Hallucination can be reduced from both the training side and the system side.
- Training side: include “refusal to answer” samples so the model states that it cannot confirm something when evidence is insufficient, instead of fabricating conclusions.
- Retrieval side: improve recall quality so key passages make it into the context.
- Generation side: constrain the output format so every conclusion carries an evidence identifier.
- Validation side: use rules to check values, units, and dates, and intercept abnormal content.
5. The 3D Modeling Scenario: Spatial Understanding and Code-Driven Modeling
The difficulty of 3D modeling lies in converting natural language descriptions and reference images into precise spatial relationships. The model must determine object proportions, relative positions, and constraints, then convert this information into executable modeling instructions.
5.1 Spatial Understanding
Spatial understanding involves three capabilities: extracting dimensions and relative relationships from text, estimating proportions from reference images, and specifying a clear resolution when the two conflict. For example, if the text says “the bracket length is twice the base length” while the reference image shows a ratio closer to 3:2, the model should flag the contradiction rather than arbitrarily choosing one result.
When training this capability, samples should include verifiable geometric annotations, such as bounding box dimensions, keypoint coordinates, and constraint lists. With ground truth available, the reward function can judge whether the model’s proportion inference is correct.
5.2 Code-Driven Modeling
Code-driven modeling means the model outputs executable modeling scripts that run in general-purpose 3D or computer-aided design software. The advantages are clear parameters, reproducibility, and easy version management. Below is an example of generating a parametric part:
def build_bracket(base_length: float, base_width: float, ratio: float):"""Generate the bracket geometry description based on base dimensions and a ratio parameter."""if base_length <= 0 or base_width <= 0 or ratio <= 0:raise ValueError("Dimensions and ratio must be positive numbers")arm_length = base_length * ratiogeometry = {"base": {"type": "box", "size": (base_length, base_width, 5.0)},"arm": {"type": "box", "size": (arm_length, base_width, 20.0)},}# Validation: arm length should not exceed three times the base length; otherwise require manual confirmationif arm_length > base_length * 3:geometry["warning"] = "Arm length exceeds the normal range; manual review required"return geometry
The key to code-driven modeling is that outputs are verifiable. Generated scripts should first be executed in a sandbox, then checked for geometric dimensions, topology, and constraint satisfaction. Only scripts that pass validation should enter the production environment.
6. Engineering Deployment: Evaluation, Risk, and Collaboration
6.1 Evaluation System
Evaluation sets for specialized scenarios should be built in layers by task type:
- Verification tasks: combinations of files containing measurement-basis traps and erroneous entries.
- Modeling tasks: requirement descriptions containing dimension annotations and constraints.
- Research tasks: questions requiring multi-hop reasoning and citations.
Regression tests should run after every model iteration, focusing on whether the hallucination rate, numerical accuracy, and format compliance rate have regressed. Looking only at aggregate scores can easily hide localized degradation.
6.2 Risk Control
Outputs in specialized scenarios influence decisions, so clear boundaries for human-machine collaboration should be established.
- High-risk operations—such as publishing data externally or modifying official model files—must go through manual confirmation.
- Model outputs should be labeled with confidence levels or evidence coverage rates so reviewers can prioritize their work.
- Sensitive data should be de-identified during training and inference, with access permissions following the principle of least privilege.
- Logs must record inputs, outputs, and validation results for post-hoc auditing.
6.3 Cost and Benefit
Reducing manual review costs is the main motivation for applying models in specialized scenarios. To judge whether the investment is worthwhile, compare three metrics: the change in manual time per task, the detection rate of anomalous entries, and the extra verification workload caused by false positives. Only when all three improve together has the cost truly been reduced.
7. Practical Recommendations
Post-training for specialized scenarios should start small. The recommended sequence is: first define the automatic judgment criteria for the task, then build an annotated evaluation set, then pilot in a single stage such as verification or modeling, and finally expand gradually based on regression results. Every stage should retain a manual review entry point, and error samples should be fed back into the next round of training.
The value of large models in specialized domains depends on whether they can produce verifiable, traceable, and executable outputs. Pursuing fluent expression alone cannot meet the requirements of finance and engineering scenarios.
