TRANSMISSION // 2611.29716v1

A Shared Toolkit Helps AI Agents Write More Valid Finance Code

Source published

Fin-RSI combines reusable financial programs, checks and feedback methods. In a benchmark of six trading-position tasks, helping 20 open-weight models find the right tool increased the share of valid programs, especially for larger models.

AI-generated conceptual illustration for A Shared Toolkit Helps AI Agents Write More Valid Finance Code
AI-generated conceptual illustration; not documentary evidence.

Financial code can run without being right: a program may mishandle a stock split or use information from the same trading day. Fin-RSI is a shared Python toolkit designed to help language-model agents find tested financial routines and catch some such errors. In a limited benchmark, tool discovery improved how often models produced valid programs.

A financial program can execute successfully and still make a basic mistake. For example, a stock split can make a share’s quoted price drop sharply without changing the company’s value. A program that mistakes that adjustment for a real collapse may generate misleading trading positions. Language-model agents that write financial code need not only access to useful tools, but also ways to find the right tool and check their work.

Fin-RSI, introduced in a new arXiv preprint, is a Python library built around that problem. It brings together financial routines, written guidance, program checks and methods for revising code after feedback. The authors’ central test was whether models could produce valid programs more often when the library helped them locate an appropriate, tested implementation.

One library, several ways to check code

Fin-RSI offers 67 tools through interfaces for Python, MCP and model-provider tool schemas. Its catalogue includes 48 tested algorithms across 11 task types. The library’s routines aim to enforce conventions such as adjusting for stock splits and setting a position based on information available before the trading day in question.

The authors also built 39 guards to check data, inputs and generated programs. Some tests look for properties that should hold even when the correct output is not known in advance. For instance, expressing prices as adjusted closes should not change a program’s output. Another test changes prices from a chosen row onward: if the program’s positions up to that row change too, it may be trading on information that would not yet have been available.

A separate benchmark grader compares a submitted program against an independent reference implementation. The model does not see that hidden grade while it is working; it receives information about whether the program runs and which visible checks it fails. This separation matters: passing a check is not automatically the same as producing the correct answer.

Testing whether models can find the right routine

The benchmark contains 34 financial programming tasks involving 17 algorithms, each with two variants. The study’s main experiment covered six trading-position tasks, using three synthetic data seeds. The researchers tested 20 open-weight language models from eight model families, ranging from 2 billion to 32 billion total parameters. Each model had up to three program attempts per episode.

The researchers compared five conditions, from no library access to a setup in which a tool called route() tried to match a natural-language task description to a suitable financial routine. In a separate experiment, they compared seven ways of improving programs, including retries with error messages, feedback about failed checks, written reflections and learned playbooks.

Without the library, 9.7% of episodes produced valid programs. Simply listing a tool’s interface raised that figure to 16.1%. Naming the particular routine that solved the task raised it to 29.7%. When route() selected a routine, validity reached 29.2%—close to the condition where the routine was supplied directly. In that setup, the tool matched the task’s rule in 274 of 360 episodes.

The reported gains were larger among the eight models with at least 14 billion parameters: their valid-program rate rose from 23.6% without the library to 64.6% with tool discovery. The authors also report fewer timing errors and more successful repairs after feedback. These are results about producing valid programs on the tested tasks, not evidence that the agents found profitable strategies or improved real-world investment decisions.

What the results do—and do not—show

The findings suggest that giving an agent a list of tools is not enough. The agent must be able to identify which tested implementation fits its task. Checks and specific feedback can then help it revise code. This is a practical lesson for designing software used by AI agents: discoverability and verification need to work together.

The scope is narrow, however. The main experiment used six position tasks and synthetic data, while the study’s broader benchmark includes other task types. The authors say their evaluation covers open-weight models up to 32 billion parameters; it does not establish performance for larger or closed models, all financial workflows, or live trading. A valid benchmark program is also not the same thing as a sound investment decision.

Fin-RSI is presented in an arXiv preprint, which may not have undergone peer review. The paper describes a released library and benchmark, but its claims should be read as evidence from this particular setup, not as a general guarantee of financial reliability. The source also notes that the authors plan to expand the tools and task coverage.

Reviewed cross-references

These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.

  • Can an AI model learn financial modeling from its own challenges?

    Supporting evidence: Both studies report gains in financial-agent tasks when systems use execution-based feedback, supporting the bounded proposition that such feedback can aid improvement. Fin-RSI reports checks rejecting timing errors and retries recovering some valid episodes; FinEvo reports higher spreadsheet-task success after learning from self-generated challenges. The methods and task settings differ, so these results do not establish comparable effect sizes or a shared mechanism.

    Model review: · openai-codex/gpt-6-luna

    Evidence and provenance

    Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.

    • 2611.29716v1 — Original paper

      Excerpt reference: static/papers/2611.29716v1.md:355-423
      Basis: Paper text
      Source SHA-256: 07a4799fcec7e409cb291e83bf87d0d471da71165fea1e6067a55a5baca9d44e

    • 2611.29716v1 — Original paper

      Excerpt reference: static/papers/2611.29716v1.md:210-279
      Basis: Paper text
      Source SHA-256: 07a4799fcec7e409cb291e83bf87d0d471da71165fea1e6067a55a5baca9d44e

    • 2611.28239v1 — Original paper

      Excerpt reference: static/papers/2611.28239v1.md:13-84
      Basis: Paper text
      Source SHA-256: fe937b13929f8434b34165b368fca60c8d3121f6bb826aa17bc9ead0908ca20e

    • 2611.28239v1 — Original paper

      Excerpt reference: static/papers/2611.28239v1.md:376-463
      Basis: Paper text
      Source SHA-256: fe937b13929f8434b34165b368fca60c8d3121f6bb826aa17bc9ead0908ca20e

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.