A Safe Way to Do Quant Research with LLMs: From Questions to Verification and Research Records
Review a research draft by tracing its claims to data and calculations, not by how plausible its prose sounds. “Past returns were positive” and “trading that signal made money” are different claims. A citation may not support the full conclusion attached to it.
This synthetic case follows:
Fix the question and inputs→ write a review request→ separate the response into claims→ compare with inputs and calculations→ record accepted content and remaining questionsPrices and rules are illustrative. The flawed response was deliberately written for review practice, not collected from a model evaluation. The Python calculations and tests below are the part actually executed.
1. Narrow the question and label the evidence
The question is:
Can we distinguish a positive five-trading-day signal return from the return earned after entering once that signal is known?
This is not a search for profitability or an evaluation of predictive accuracy. Divide the evidence into three groups.
R1. Synthetic prices
Assume D1 through D8 are consecutive trading observations, without actual dates or an exchange calendar.
| Observation | SYN_A open | SYN_A close |
|---|---|---|
| D1 | 100 | 100 |
| D2 | 101 | 101 |
| D3 | 102 | 102 |
| D4 | 103 | 103 |
| D5 | 104 | 104 |
| D6 | 104 | 105 |
| D7 | 110 | 100 |
| D8 | 99 | 101 |
R2. Calculation rules
Signal becomes known after observing D6 close.Five-trading-day return = D6 close / D1 close - 1.Select if the signal is strictly positive.Enter at D7 open; exit at D8 open.Holding-period return = D8 open / D7 open - 1.Assume zero costs in this small calculation.D1 through D6 contain six observations and five trading-day intervals. D6 close determines the signal; D7 open determines entry. They are not interchangeable.
R3. Missing evidence
Actual ETF dataOther tradesComparator-strategy resultsReal fills and costsModel prediction recordsTask time and errors with and without LLM assistanceListing missing evidence makes unsupported conclusions visible.
2. Specify both response format and judgment boundaries
A request accompanying these inputs could be:
Draft a research memo using only R1 prices and R2 rules.Separate:1. Facts directly stated in the inputs.2. Calculated values and their formulas.3. Claims that cannot yet be established.Calculate signal return and post-entry holding return separately.Identify the observation and price column used in each calculation.Do not change R2's entry timing.If a value is missing, identify it and defer the calculation.Without the additional evidence listed in R3, do not concludepredictive accuracy, real strategy superiority, or realistic net performance.End with items for human verification.Do not imply that source labels alone complete verification.This format supports review; it does not guarantee correctness. Preserve the accompanying inputs as well as the prompt. Identical wording with different prices or rules asks a different question.
3. Split a flawed response into individual claims
The following is deliberately incorrect review-practice material:
D6's five-day return is 5%, so the signal strategy earned 5%. Entering at D6 close 105 and exiting at D8 open 99 gives about -5.71%. The positive signal confirms a correct upward prediction. This calculation establishes no future-information leakage and validity after costs.
Assess claims separately rather than labeling the whole paragraph correct or incorrect.
| Claim | Comparison with evidence | Decision |
|---|---|---|
| D6 five-day return is 5% | 105 / 100 - 1 = 5%, consistent with R1/R2 | Accept |
| Strategy earned 5% | Substitutes signal-history return for post-entry performance | Correct |
| Entry at D6 close 105 | R2 specifies D7 open | Reject |
| Holding return about -5.71% | Correct arithmetic, wrong entry input | Correct input basis |
| Upward prediction was correct | Confuses positive signal with prediction success | Reject |
| No future-information leakage | Full data/code flow was not validated | Withhold conclusion |
| Valid after costs | Costs assumed zero; no comparison evidence | Withhold conclusion |
A calculator alone misses the central error:
99 / 105 - 1 ≈ -5.71%The arithmetic is correct, but entry price 105 violates the research rule. Check both arithmetic and input selection.
4. Check the fixed rules with a small calculation
Historical return used for the signal:105 / 100 - 1 = +5%Return after entry:99 / 110 - 1 = -10%A positive past signal and a subsequent loss can coexist. One example does not establish general strategy failure either; the question is whether signal and holding intervals are distinguished.
The following uses only the standard library:
from fractions import Fraction as Frows = [ {"day": f"D{i}", "open": F(o), "close": F(c)} for i, (o, c) in enumerate([ (100, 100), (101, 101), (102, 102), (103, 103), (104, 104), (104, 105), (110, 100), (99, 101), ], 1)]def signal(data, t): if t < 5 or t >= len(data): raise ValueError("SIGNAL_WINDOW_UNAVAILABLE") return data[t]["close"] / data[t - 5]["close"] - 1def inspect_trade(data, t): past_return = signal(data, t) if t + 2 >= len(data): raise ValueError("EXIT_PRICE_UNAVAILABLE") entry = data[t + 1] exit_row = data[t + 2] holding_return = ( exit_row["open"] / entry["open"] - 1 ) return { "signal_return": past_return, "selected": past_return > 0, "entry_day": entry["day"], "exit_day": exit_row["day"], "holding_return": holding_return, }result = inspect_trade(rows, 5)assert result == { "signal_return": F(1, 20), "selected": True, "entry_day": "D7", "exit_day": "D8", "holding_return": F(-1, 10),}print("signal:", f'{float(result["signal_return"]):.2%}')print("holding:", f'{float(result["holding_return"]):.2%}')print("trade:", result["entry_day"], "->", result["exit_day"])Output:
signal: 5.00%holding: -10.00%trade: D7 -> D8holding_return calculates a return over specified entry/exit prices; it is not a multi-asset engine updating quantities, cash, and costs. Inputs are assumed chronologically ordered and valid. No real trading calendar or price-quality checks are implemented.
Does the known signal survive changes to future rows?
First calculate it using data only through D6:
assert signal(rows[:6], 5) == F(1, 20)Then change D7 and later values:
changed = [dict(row) for row in rows]changed[6]["close"] = F(999)changed[7]["open"] = F(777)assert signal(changed, 5) == F(1, 20)This establishes that this function's signal on these inputs is unchanged by the tested future-row edits. It does not prove that an entire research system is free of every leakage type.
Are wrong entry prices and missing exit prices distinguished?
wrong_return = ( rows[7]["open"] / rows[5]["close"] - 1)assert wrong_return == F(-2, 35)assert wrong_return != result["holding_return"]try: inspect_trade(rows[:7], 5)except ValueError as error: assert str(error) == "EXIT_PRICE_UNAVAILABLE" print(error)else: raise AssertionError("missing exit was accepted")Output:
EXIT_PRICE_UNAVAILABLEDo not substitute the last available price or zero return when the required exit price is missing.
These calculations and checks passed with Python 3.14.5 while preparing the revision on 2026-10-24. This is synthetic code verification, not measurement of model-answer accuracy.
5. Turn review results into a research memo
Retain what was checked and which claims were withdrawn, rather than only writing “review complete.” The inputs and execution above support this memo:
Title: Separating a five-day signal from post-entry returnRecorded: 2026-10-24Inputs:Eight synthetic SYN_A rows in R1 and the R2 rules.Not actual ETF data.Question:Can the historical signal at D6 be distinguished fromreturns after entry at D7 open?Established:- D6 close / D1 close gives a +5% signal.- The strictly positive selection rule is satisfied.- Specified entry is D7 open 110.- Exit is D8 open 99.- Holding-period return is -10%.Corrections:- Do not call the signal's +5% a strategy return.- Exclude the calculation using D6 close as entry.- Do not accept claims of prediction success, strategy superiority, or validity after realistic costs.Execution checks:- Python 3.14.5, standard library.- Signal, entry/exit dates, and holding return matched expectations.- Data through D6 produces the same signal.- Future-row changes leave that signal unchanged.- Missing exit price stops calculation.Unverified:Real-data quality and trading-date mapping; actual fills/costs;performance across trades; superiority over a comparator;LLM productivity and error-detection effects.Response provenance:The flawed response was written for review education,not collected from a separate model evaluation.Conclusion:Signal and holding intervals were calculated separately for thesesynthetic inputs. No conclusion about real performance or LLM utility.Preserving inputs, program versions, processing steps, and intermediate results follows basic reproducible-computation principles. This memo format is not an official quant-research standard. Sandve et al., Ten Simple Rules for Reproducible Computational Research
Store referenced inputs and code with a real research memo. Environment details alone cannot reconstruct the exact program and data.
6. What to retain after an actual LLM call
Unlike the constructed response here, a real model invocation needs input/output records.
| Record | Purpose |
|---|---|
| Interface and available model identifier | Identify the tool/model |
| Request time and exposed settings | Trace execution conditions |
| Full prompt and supplied material | Establish what the model received |
| Original response | Separate output from later editing |
| Tool calls and returned evidence | Trace what was actually inspected |
| Accepted, revised, and rejected claims | Separate human review from model output |
| Retries and changes to prompts/material | Preserve the route to the final answer |
Do not invent hidden version identifiers or settings. Keep edited responses separate from originals. Recording a run does not guarantee the identical response can be regenerated. First establish whether this result can be explained from its inputs and process.
7. Separate implementation fixes from changes to research rules
| Change | Record |
|---|---|
| Code implements D6 entry instead of specified D7 | Bug fix; preserve earlier code/results and distinguish rerun |
| Decide to change entry to D6 after seeing results | Research-rule change, reason, separate comparison |
| Acquire new prices | Input version and differences |
| Edit response wording | Original and edited output |
| Retry for a better response | Attempt count and prompt/input changes |
Changing entry after observing a loss changes the original question. Do not present the new result as validation of the original rule.
LLMs can draft comparison tables, test candidates, and records. Acceptance should rest on agreement with evidence, rules, and execution, not confidence or response length.
This case ends with a memo and synthetic calculations; no order system was built or connected. It also does not establish time savings or better error detection. Those require comparative conditions, task durations, and records of detected and missed errors. The quant-AI series review connects current evidence with remaining questions.
Report an error or share feedback
Open a draft with this article’s title and URL. Review the message and recipient before sending.
Open email draftIf no email app opens, copy these details into your usual email service.
Related posts
Quant & Data Research Designing a Logistic Regression Comparison: Timing, Evaluation, and Failure Handling
A design for comparing logistic regression with a baseline: timing, common evaluation periods, costs, and failure handling, distinguished from actual model results.
Quant & Data Research Why shift(1) Is Not Enough: A Time Contract for Signals, Execution, and Labels
Synthetic checks for signal timing, execution, return attribution, completed labels, and preprocessing, including deliberately faulty implementations.