AI quantitative research workflows

Updated 2026-09-06

Use agents to propose and implement hypotheses, then let versioned data and reproducible experiments evaluate them. Keep model conversation and numerical computation distinct.

Turn an idea into a falsifiable experiment

Write down the mechanism you want to test, the observable variables, the intended universe and the conditions that would reject the idea. An agent can help translate that specification into code, but it should not redefine the success criterion after seeing results. Separate implementation questions from research questions: a factor can be calculated correctly and still contain no useful signal. Save a small specification before the first code-generation request so the eventual experiment can be compared with the original intent.

Choose the right role for RD-Agent, Qlib and FinRL

RD-Agent automates parts of research development, including iterative implementation and feedback. Qlib supplies a quantitative workflow for data, models and evaluation. FinRL provides reinforcement-learning research environments. These projects can inform different stages, but they are not interchangeable chat clients. LLM requests belong to the agent's reasoning and coding layer. Feature construction, training, simulation and metrics consume computation in the experiment environment. Record both paths so a model budget is not mistaken for the complete resource budget.

ComponentPrimary workWhat you must supply
Research agentHypothesis, implementation, revisionTask contract and permitted tools
QlibData, training, signal and portfolio evaluationCompatible dataset and experiment configuration
FinRLPolicy training in a market environmentEnvironment, reward definition and evaluation design
Human reviewerMethodology and interpretationIndependent acceptance criteria

Fix the data contract before generating factors

Document instrument identity, timezones, adjustment policy, calendar and missing-value handling. For US equity research, use an appropriate US dataset and region configuration; changing a label on a different-market example does not migrate its assumptions. Retain historical universe membership and publication timestamps for fundamental or textual features. Normalize and fit transformations only on the allowed development data. A feature calculated from a later restatement can leak future information even when its accounting period appears to belong to the past.

Use the official workflow structure as an execution boundary

Qlib's documented qrun interface executes a configured data, model and evaluation workflow and records artifacts. Supply a reviewed configuration rather than asking an agent to improvise the entire environment at runtime. The command below is the official invocation pattern; the filename stands for your own complete configuration. Validate the dataset path, region, instrument universe, benchmark and train/validation/test segments before execution. A small data-loading check should fail clearly if the required history or fields are unavailable.

# Requires an installed Qlib environment and a reviewed configuration.
qrun configuration.yaml

Inspect the complete experiment artifact

Keep the candidate code, configuration, environment identity, seed where relevant, data manifest and recorded outputs together. Inspect risk, turnover and benchmark context as well as any headline result. The official Qlib figure illustrates the kinds of analysis a quantitative workflow can expose. It is an service example, not a result from this guide. A chart is only useful when the underlying trades or signals, input assumptions and evaluation period can be inspected, including unfavorable intervals.

Official Qlib example analysis figure showing a multi-panel quantitative report.
Official Qlib example, revision 79633dd9, MIT license. Service illustration, not an APIsRouter experiment result.

Control the search process and execution environment

Give generated code a disposable, resource-bounded environment with only the datasets and tools it needs. Review network access, file mounts and secret exposure before execution. Limit the number of candidate revisions and preserve rejected experiments. If an agent repeatedly uses a held-out score to improve code, that score has become development feedback. Reserve a genuinely untouched evaluation window or another predeclared evaluation design. Compare candidates against an appropriate baseline and record every selection decision, not only the final implementation.

Budget model work and computation separately

Track hypothesis generation, code revisions, embeddings and model retries in a request ledger. Track training, simulation, storage and data access in a separate resource ledger joined by experiment ID. A local cache can reduce repeated work but must be keyed by code and data identity; otherwise it can return a result from a different candidate. Stop when the iteration or compute budget is reached. Summarize the best-supported finding and remaining uncertainty rather than letting the agent search indefinitely for a favorable result.

Evidence and scope

This walkthrough draws on the official RD-Agent, Qlib and FinRL sources linked below. The configuration pattern and service figure are source-backed; no RD-Agent loop, Qlib training run, FinRL policy or financial return was executed or measured for this page. Use the linked RD-Agent guide for version-specific model configuration, and retain a separate execution record when running your own experiment.

FAQ

Does Qlib need an LLM API key?

Its core quantitative workflow does not. An attached research agent may need chat or embedding credentials, while Qlib performs the configured numerical work.

When is FinRL a better fit than a factor workflow?

When the research question concerns sequential policy learning in a defined environment. The environment and reward design become central parts of the experiment.

Can the agent choose the test period?

A reviewer should approve evaluation boundaries before development. Letting the agent select favorable periods after seeing results weakens the experiment.

What makes a generated factor reproducible?

Preserved code, data version, calendar and adjustment rules, dependency versions, preprocessing state and the complete evaluation configuration.

What should I do when generated code fails?

Keep the code and structured failure evidence, fix the smallest affected stage in a new experiment version, and preserve the original attempt in the search history.