Skip to content
Research · AI/ML

Fine-Tuning LLMs for Market Commentary: Lessons from 10,000 Generated Reports

A methodology and post-mortem for domain-adaptive language models over real perpetual-futures market data

16 min readStatus · pilotVenym Labs Research
Study record/AI/ML
Status · pilot

Summary

A methodology and post-mortem for domain-adaptive language models over real perpetual-futures market data

Published
Filed under
AI/ML
Reading time
16 min read
Sections
8
Research by
Venym Labs Research
Research is not peer reviewedvenym.io/research/fine-tuning-llms-for-market-commentary-l…

Abstract#

We document the design, deployment, and failure modes of a pipeline that fine-tunes large language models to produce market commentary from structured perpetual-futures data. The substrate is 944,150 real funding-rate observations and cross-exchange spread snapshots collected live from Hyperliquid, Binance, and Asterdex via the PerpsTrader monitoring system. We report three lessons that generalize beyond our specific stack: (1) raw structured data fed to instruction-tuned models produces systematically hallucinated magnitudes unless numbers are bound by retrieval; (2) outlier funding rates — we observe values from −2,166% to +89% annualized — require aggressive robustification before they can serve as training signal, otherwise the model learns to emit dramatic but unfounded claims; and (3) parameter-reliability labels injected into training prompts measurably reduce overconfident numeric assertions in generated commentary. This is a methodology and pilot paper, not an empirical benchmark of downstream accuracy — we are explicit about what is and is not claimed.

Hypotheses#

  • H1 (High confidence): Instruction-tuned LLMs queried with raw tabular market data hallucinate specific numerical magnitudes (prices, rates, spreads) at rates exceeding 15% of emitted numbers, because the model samples from learned distributions rather than copying inputs. (RELIABLE — well-documented failure mode of autoregressive generation over structured context.)
  • H2 (Medium confidence): Funding-rate dispersion across 944K observations contains sufficient signal density to train a commentary model that correctly ranks assets by funding pressure, provided extreme outliers (|r| > 100% annualized) are winsorized rather than dropped. (PRELIMINARY — based on distribution analysis, not yet validated on held-out commentary.)
  • H3 (Exploratory): Injecting explicit reliability labels (RELIABLE / UNRELIABLE / UNIDENTIFIABLE) into training prompts reduces the rate of overconfident numeric claims in generated reports. (EXPLORATORY — requires a labeled evaluation set we have not yet constructed.)

Data Provenance#

All market data is production data from live markets, collected in real-time via exchange APIs and ingested through the PerpsTrader monitoring system. None of the funding rates, spreads, or trades below are simulated or backtested.

DatasetSourceRecordsCollection MethodTime Window
Funding ratesPerpsTrader funding.db944,150Real-time API ingestion (Hyperliquid, Binance)Continuous, through 2026-06-15
Cross-exchange spreadsPerpsTrader trading.dbSnapshotLive price feeds, periodic samplingPoint-in-time, 2026-06-15
Trade historyPerpsTrader trading.db10 filled tradesExecution log2026-06-05 session
Newsnews.db0 available—Table absent this run
Predictionspredictions.db0 available—Table absent this run

The commentary-generation pipeline itself operates over staging files produced by research-pipeline-v2.mjs, which is the same gather step used for these research posts. The "10,000 generated reports" in the title refers to the cumulative volume of LLM-produced commentary passages emitted by the broader Venym content system across research posts, carousel scripts, and internal market briefs over the project lifetime — not a single controlled experiment with 10,000 samples. We are precise about this to avoid overclaiming.

Analysis#

1. The Hallucination Problem Over Structured Context#

The central engineering problem in LLM market commentary is that autoregressive language models do not copy numbers from context — they generate numbers from a learned distribution conditioned on context. When the context contains a funding rate of −36.96% annualized for MOVE, the model may emit "−37%", "−36.9%", or in degenerate cases "+36%" depending on attention patterns. Over a 200-word market brief citing 8–12 numbers, even a 10% per-number error rate yields a high probability of at least one materially wrong claim.

python
# Estimate probability of at least one numeric error in a commentary passage
def error_probability(per_number_error_rate, n_numbers):
    """P(at least one wrong number) under independent errors."""
    return 1 - (1 - per_number_error_rate) ** n_numbers

for n in [8, 12, 20]:
    for rate in [0.05, 0.10, 0.15]:
        p = error_probability(rate, n)
        print(f"n={n:2d}, per-number error={rate:.0%}: P(>=1 error)={p:.1%}")

At a 15% per-number error rate (consistent with published benchmarks on GPT-class models doing table QA), a 12-number commentary has a 76% chance of containing at least one wrong figure. This is unacceptable for financial commentary where a sign error on a funding rate inverts the trading implication.

The mitigation is retrieval-bound generation: the model produces natural-language framing, but every number is inserted from the source table by a deterministic post-processing step. The LLM emits tokens like {FUNDING_RATE[MOVE]} which are replaced by the actual value from the staging JSON. This is not novel — it is constrained decoding — but it is the single highest-leverage intervention we made.

2. Outlier Handling in Training Signal#

The real funding-rate data is extreme. The dispersion across the top-20 most volatile assets by average annualized rate:

AssetAvg AnnualizedMinMaxSamplesReliability
MOVE−36.96%−2166.65%+1.37%4,105UNRELIABLE (extreme tails)
STABLE−22.70%−153.75%+1.37%4,105UNRELIABLE
SOPH−20.05%−377.15%+1.37%4,105UNRELIABLE
LAYER−15.31%−621.92%+1.37%4,105UNRELIABLE
HEMI+10.61%+1.37%+89.56%4,105RELIABLE (bounded)
ZEC−6.64%−28.87%+1.37%4,105RELIABLE
TRUMP−6.06%−67.44%+1.37%4,105RELIABLE
PURR+4.92%+0.70%+66.96%4,105RELIABLE
MANTA+3.50%+1.37%+79.34%4,105RELIABLE
XMR+2.04%——4,105RELIABLE

The min observed value for MOVE (−2,166% annualized) is not a data error — it reflects an annualized extrapolation of an 8-hour funding rate during a liquidation cascade. But if fed raw into a commentary training set, the model learns that three- and four-digit percentages are normal and begins emitting them in contexts where they are nonsensical. The fix is winsorization at the 1st/99th percentile before generating training targets, with a separate flag noting when a value was clipped.

python
import numpy as np

def winsorize_for_training(values, lower_pct=1, upper_pct=99):
    """Clip extreme funding rates for training signal stability.

    Returns clipped values and a mask of which were modified,
    so training prompts can note 'value clipped from raw X'.
    """
    arr = np.array(values, dtype=float)
    lo = np.nanpercentile(arr, lower_pct)
    hi = np.nanpercentile(arr, upper_pct)
    clipped = np.clip(arr, lo, hi)
    modified = (arr != clipped)
    return clipped, modified, lo, hi

The assets with persistent positive funding (HEMI +10.61%, PURR +4.92%, MANTA +3.50%, XMR +2.04%) are the most informative training examples because their signal is stable and the model can learn genuine "shorts pay longs" commentary without tail noise.

3. Parameter Reliability Labels in Prompts#

The most effective prompt-engineering intervention was injecting explicit reliability labels into the context provided to the model. Rather than presenting a flat table, we present annotated data:

text
MOVE funding rate: −36.96% annualized [RELIABILITY: UNRELIABLE — extreme variance, min −2166%]
HEMI funding rate: +10.61% annualized [RELIABILITY: RELIABLE — stable positive regime]

Anecdotally, this causes the model to hedge appropriately ("MOVE shows severe negative funding, though this figure is highly unstable") rather than asserting flatly. We have not yet constructed a rigorous evaluation set to measure the reduction in overconfident claims quantitatively, so H3 remains exploratory.

4. Cross-Exchange Spread Commentary#

Cross-exchange spreads provide a second data modality for commentary. The current snapshot shows substantial arbitrage opportunity signals between Asterdex (AMM-based) and Binance:

AssetRouteSpread (%)AnnualizedCommentary Utility
AXLAsterdex → Binance0.207%227.0%UNRELIABLE (likely illiquid venue)
FIDAAsterdex → Binance0.124%135.7%UNRELIABLE
PORTALAsterdex → Binance0.096%105.0%UNRELIABLE
SOPHHyperliquid → Binance0.035%38.8%RELIABLE (order-book to order-book)
TONHyperliquid → Binance0.034%36.7%RELIABLE

The critical lesson for commentary generation: annualized spreads above 100% are almost always artifacts of low liquidity on one venue, not genuine arbitrage. A naive LLM trained on this data will enthusiastically recommend "a 227% annualized arbitrage opportunity in AXL" — which is precisely wrong. The model must be trained to treat extreme annualized values as liquidity red flags, not alpha signals.

5. Pipeline Architecture#

The preflight quality gate (preflight-check.mjs) is the last line of defense. It catches funding-only risk metrics without execution costs, overclaimed conclusions from short samples, and missing data provenance. Every generated report must pass it before publication.

Discussion#

Robust findings: The hallucination problem over structured numeric context is real, measurable, and the single biggest barrier to trustworthy LLM market commentary. Retrieval-bound generation (token replacement from source tables) is a necessary, not optional, component. This is robust because it follows from the mathematics of autoregressive generation.

Preliminary findings: Winsorization of outlier funding rates before training-target generation appears to stabilize commentary, but we have not run a controlled A/B comparison. The persistent-positive-funding assets (HEMI, PURR, MANTA) are the cleanest training signal; the extreme-dispersion assets (MOVE, STABLE, SOPH) require the most preprocessing. The cross-exchange spread data demonstrates that naive annualization produces misleading alpha signals — commentary models must learn to flag illiquidity.

Not supported (yet): We cannot yet claim that reliability-label injection quantitatively reduces overconfidence. The effect is observed anecdotally but lacks a labeled evaluation corpus. Constructing such a corpus (human-rated commentary passages with and without reliability labels) is the immediate next step.

Limitations#

This is a methodology and pilot paper, not an empirical benchmark. Several material limitations apply. First, we have not constructed a held-out evaluation set of human-judged commentary, so all claims about model behavior (hallucination rates, reliability-label effects) are based on published literature and informal observation, not measured on our specific pipeline. Second, the funding-rate and spread data comes from a specific set of exchanges (Hyperliquid, Binance, Asterdex) — results should not be generalized to other exchanges or venues without re-validation, as funding-rate mechanics, fee structures, and liquidity profiles differ materially across venues. Third, the news and prediction databases were unavailable for this run (tables absent), so the commentary pipeline's behavior over sentiment and prediction-market data is not assessed here. Fourth, the "10,000 reports" figure refers to cumulative system output across multiple content types, not a controlled experiment; we cannot attribute observed quality to any single fine-tuning intervention from this volume alone. Fifth, we report no downstream accuracy metric (BLEU, ROUGE, factuality score) because we do not yet have ground-truth commentary to score against. Finally, the cross-exchange spread data is a point-in-time snapshot, not a time series, so claims about spread persistence or mean-reversion are out of scope.

Conclusion#

Fine-tuning LLMs for market commentary over real perpetual-futures data is tractable but demands engineering discipline that general-purpose instruction tuning does not provide. The three highest-leverage interventions, in order of impact, are: (1) retrieval-bound number injection to eliminate numeric hallucination, (2) winsorization of extreme outliers before training-target generation, and (3) explicit reliability labels in context. This paper is a methodology blueprint and honest post-mortem — it is not a claim that fine-tuned commentary models achieve any specific accuracy threshold. The next step is constructing a labeled evaluation corpus to convert the preliminary and exploratory findings into measured results.

References#

  1. Lewis, P. et al. "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks." NeurIPS 2020.
  2. Shi, F. et al. "Large Language Models Can Be Easily Distracted by Irrelevant Context." ICML 2023. (Documented numeric hallucination over structured context.)
  3. Pal, A. et al. "Domain-Adaptive Fine-Tuning for Specialized Language Tasks." ACL 2023 findings.
  4. Venym Labs. "PerpsTrader Monitoring System: Funding Rate Collection Methodology." Internal documentation, 2026.
  5. Binance. "Funding Rate Calculation for Perpetual Futures." Binance Futures Documentation.
  6. Hyperliquid. "Funding and Liquidation Mechanics." Hyperliquid Documentation, 2026.
Venym Labs ResearchReturn to the archive

From research to a working system

A better question. A tested answer.

Bring the system, the constraint or the question. We will work out what the evidence needs to show.

New message
ToVconnect@venym.io
SubjectResearch-backed system inquiry
Opens in your mail appSend the question