Small Models, Big Results: Training a Finance Agent for Under $500 — Charles Dickens, Snorkel AI

AI Engineer · 17 min · 151 sentences · from YouTube's caption track

Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.

  1. 00:01[music]
  2. 00:12Everyone, thanks for joining.
  3. 00:15I'm Charles and I'm a research scientist at Snorkel AI.
  4. 00:19And today I'm going to be talking about how we got a 4 billion parameter model to outsmart its 235 billion parameter variant.
  5. 00:29And this is a specific result in a simulated financial environment, but I think there are general takeaways that I want to make sure taken home.
  6. 00:38And the first is for enterprise AI workloads, reliability and specialization uh can actually outweigh raw parameter scale.
  7. 00:49And this is possible with high-quality data that actually represents the domain and task distribution that you're targeting.
  8. 00:56And uh this can result in smaller models that can achieve parity with frontier models at just a fraction of the cost.
  9. 01:04So, before I get to it, I'm going to take this opportunity to introduce ourselves a little bit.
  10. 01:10This is our team.
  11. 01:11We're a frontier AI data lab and our team, we have founders from labs at University of Washington, Wisconsin, Stanford, and an internal team of really talented FTEs, researchers, and we're in a fortunate position to play in, by that I mean build
  12. 01:26and deploy data sets and environments uh for frontier AI.
  13. 01:31And that's at the intersection of academia and industry research, but also grounded in enterprise deployments.
  14. 01:39Um and this is all to say that we have a team that's built to focus on building the best data possible to define in advanced AI.
  15. 01:49And the way we do this is threefold.
  16. 01:52First is open research and benchmarks, so we're constantly contributing to open-source benchmarking, and the project I'll be talking about today actually falls under this pillar.
  17. 02:03Um but I also want to acknowledge frontier live data and environments, as well as enterprise uh deployments are the things we work on.
  18. 02:12And under open research and benchmarks, we support research through grants, and I'll talk about opportunities here at the end of this talk, so um get ready for that.
  19. 02:24And then co-authoring with academic uh or industry partners um and leading independent research and publishing open artifacts.
  20. 02:33So, what I'm talking about today is uh a partnership with UC Berkeley Sky Computing Lab, and we built, like I said, a 4 billion parameter Qwen model to outperform its 235
  21. 02:45billion model variant on financial tasks.
  22. 02:49We saw the 4 billion parameter model, spoiler alert, uh achieve almost a 60% pass at one, while the 235 billion model uh achieved 51%.
  23. 02:59So, exciting results, and this is all uh in collaboration with I got to give credit where credit's due, Manon Rupta, Shujian Tang from the Sky Computing Lab, as well as Bhavishya
  24. 03:08and Chris Glaze and myself uh from Snorkel.
  25. 03:11And you can find all the assets, the uh training scripts, synthetic data uh on our GitHub, so check those out, and this is all open-source and available to you.
  26. 03:23So, I'll cover today what uh we see financial institutions need um from AI, and this is from our enterprise deployments uh learnings, as well as the FinQA open-source benchmark.
  27. 03:36And this is expert-validated financial question-answering data that we trained our uh and evaluated our model on.
  28. 03:42And finally, uh the training process for the RLLM FinQA 4B model.
  29. 03:49So, let's get started.
  30. 03:51This is uh the one and only slide with the Charles Dickens reference, I promise, but this is a tale of two models, I'd say.
  31. 03:57First, the large generalist versus small specialist.
  32. 04:01And the point is here, when financial institutions ask us how well does the model or the agent reason, what they typically mean is can it operate in my stack of complex schemas, legacy APIs,
  33. 04:13and tech debt?
  34. 04:14And can we trust it in realistic uh and long workflows without compounding errors?
  35. 04:19And can we reliably audit the agent?
  36. 04:21That's important in financial and legal domains, for example.
  37. 04:24Which brings us to the question is uh how can we evaluate and improve agents to make them reliable in these uh real-world environments?
  38. 04:33So, um the reflex may be to scale.
  39. 04:38We've all seen scaling law results, uh but today I'm going to argue that specialized workflows don't actually need generalists.
  40. 04:44We don't need polymaths.
  41. 04:45You know, you wouldn't call Terence Tao for a tax audit, um if you're lucky enough to have him in your contacts.
  42. 04:51You'd call the specialist that knows the forms, the tools, and the rules.
  43. 04:55So, that's why we built FinQA.
  44. 04:57This is expert-validated financial question-answering data.
  45. 05:00And I'll walk through the multi-stage pipeline of how we built this benchmark and training data.
  46. 05:06So, first is schema and data extraction.
  47. 05:10This is coming from 10-K reports.
  48. 05:13Uh these are annual reports required by the SEC for all public companies, and they're used uh by analysts for identifying risks and informing investment decisions.
  49. 05:24Uh we pull these from the Edgar system and use the Qwen 3 30 billion model to produce tables, SQL tables, approximately 6,900 of those.
  50. 05:35And we use each table to generate a single question-answer pair.
  51. 05:41And this is uh produced along with the question taxonomy that was developed with financial experts that work with these documents.
  52. 05:50And these are used as context uh for the model to generate a question-answer pair along with metadata that we'll see uh what that's used for later.
  53. 05:59And finally, the third step is verification.
  54. 06:01And this is a three-layer verification process.
  55. 06:05First is programmatic consistency checks.
  56. 06:08That's where we use um the metadata, uh which includes lineage and table names and columns to make sure we're not hallucinating those.
  57. 06:15The second is automated reviews from independent agents.
  58. 06:19And finally, expert manual review.
  59. 06:21So, humans actually going through these and making sure the questions and answers are realistic and verified.
  60. 06:29And the outcome is Snorkel's FinQA data.
  61. 06:32And this is our first pass at this.
  62. 06:35Uh realistic queries requiring planning, tool use, uh tool calling, and reasoning.
  63. 06:41And um answers are single, verifiable, final answers.
  64. 06:46And from this, um we get from the uh original set of roughly 7,000 tables, 4,000 in train, 500 in val, and 290 in the held-out benchmark.
  65. 07:01And the data is split so that no company in the benchmark overlaps um in any split.
  66. 07:08And on this data, we identified um even with frontier models, uh reoccurring discipline gaps, uh failure modes.
  67. 07:19And the first is schema hallucination.
  68. 07:21So, a model will actually assume that tables exist, column names exist, and um this can be an artifact of pre-training data, something it's seen um in its past.
  69. 07:32The next is context flooding.
  70. 07:33So, actually flooding its own context um with poorly playing queries.
  71. 07:37For example, just calling select star, um and this could overwhelm its context limits if successful.
  72. 07:45And finally, poor recovery um from errors.
  73. 07:49So, when 3235 would actually repeat the same failed strategy um instead of considering the error messages and adapting.
  74. 07:57And these failure modes are not actually just seen in the financial environment that I'm talking about today, but also what we saw in insurance underwriting.
  75. 08:05And this is a work that I'm calling out that was presented at the CAIS conference um few weeks ago.
  76. 08:15So, now I'll get into actually training the R LLM FinQA 4 billion model.
  77. 08:22Uh for this we used the R LLM uh framework and this was developed by the R Sky Computing Lab collaborators.
  78. 08:31And if you haven't used this yet, um this is a really user-friendly tool and a few core features um I want to call out is it really works with any agent framework,
  79. 08:41requires near zero code changes just using uh a decorator pattern, CLI first workflow, battle-tested results.
  80. 08:48So, um we've seen R LLM actually improve not just on this finance um case study, but also in math reasoning for example.
  81. 08:57Um multiple RL algorithms are built in, GRPO, reinforce RL, OOO for example, and you can customize those and then supports multiple uh training backends.
  82. 09:10All right, now for our training environment, um this is the uh training environment we used for our model.
  83. 09:18The agent runs in a react loop and has access to tools uh to interact with the tables we generated.
  84. 09:25The environment includes the roughly 7,000 tables we created and finally reward is binary correctness uh determined by a language model as judge.
  85. 09:34In this case, GPT 5 nano using reference-based evaluation.
  86. 09:41Training details are listed here.
  87. 09:43This is uh I guess would be interesting to folks.
  88. 09:47We have the Qwen 3 4 billion model is our base model, GRPO and binary reward uh for optimization and the RL and framework.
  89. 09:58Um we ran roughly 1,000 concurrent environments to generate trajectories and this all was a cost under $500 to get the results that we saw.
  90. 10:09Um broken down between compute roughly 420 and $40 for a judge uh the judge API.
  91. 10:17And this was on eight H100s.
  92. 10:21The first result um is the central question, can a 4 billion model uh armed with the specialized tools and training actually compete with its larger variant?
  93. 10:33And the answer is yes.
  94. 10:34So, what we saw was actually the base model's accuracy um more than doubled and it outperforms its larger variant, the 235 parameter model.
  95. 10:44And this is uh despite being a fraction of the size.
  96. 10:47And we evaluate all models shown here um on the expert curated held out 290 samples.
  97. 10:56So, a natural concern is whether this actually transfers to harder problems.
  98. 11:01So, this is just single question answer pairs on a single table.
  99. 11:05Um and to investigate this, we uh looked at our FinQA reasoning data.
  100. 11:10So, this is a development on the FinQA um data I presented earlier.
  101. 11:16And the difference here is that now we're having a dependencies on multiple tables, two to five tables, and requires sequential um decision-making and planning.
  102. 11:26And we evaluated on this data set.
  103. 11:29You can see the breakdown um as well.
  104. 11:31We have roughly 1,000 in train, 120 in validation, 80 in benchmarks.
  105. 11:38And what we see is the tool use discipline actually generalized directly from training on the simple data.
  106. 11:46And no explicit training on multi-table examples was needed actually to see lift in this multi-table variant of the data set.
  107. 11:56And we'll investigate why with the ablation studies.
  108. 11:59But the next concern we had was whether this result would generalize to more general use cases.
  109. 12:07So for this we use the BFCL benchmark and this measures general tool calling capability.
  110. 12:13And overall accuracy was actually slightly improved and then um we had also minor gains on multi-turn and memory.
  111. 12:24So specialization didn't actually erode the model's broader tool use competence when we did RL fine-tuning for this model.
  112. 12:34So to isolate what drove this performance, we ran ablation study on data mixtures, so different ways we can combine the training data we had.
  113. 12:42The first is just training on FinQA data and the second single and multi-table and finally a curriculum where we start with single and then move to multi.
  114. 12:51And surprisingly, just training on the simpler set resulted in the most lift.
  115. 12:56And this partially explains why the generalization result we saw earlier.
  116. 13:01The bottleneck was never reasoning depth, it was just tool use, meaning the model where it was actually failing and improving the reliability of that.
  117. 13:09And once you master the fundamentals, it could compose those skills.
  118. 13:18Yeah, so oops, let me go back.
  119. 13:21The next natural question is whether more informative reward signals, Um, for example, rewarding intermediate steps, uh, table access, query completeness, things like that could actually accelerate learning.
  120. 13:34Uh, so this is different from curriculum, for example.
  121. 13:36And the most sophisticated variant we came up with was, uh, a rubric.
  122. 13:41And this uses fine-grained scoring with, uh, multiple weighted components.
  123. 13:45And this is actually coming came up with with experts.
  124. 13:48Um, and despite this investment in reward engineering, we actually again saw, um, simpler was better.
  125. 13:54A single binary reward signal, um, was what got us the most lift on this data.
  126. 14:02Which led us to a blueprint, um, that we've been developing for enterprise agents.
  127. 14:07Um, and generally, I'd say this study showed us that small models uh, can successfully be trained uh, with RL um, when you have quality data to uh, represent the target
  128. 14:19um, outcomes and tasks.
  129. 14:21And this can result in better deployment economics uh, for specialized tasks and domains.
  130. 14:27And um, we've seen this and repeated this result in other areas including health care, law, and insurance, um, which I pointed to earlier.
  131. 14:36So, check that out.
  132. 14:37Um, and our point of view as far as building um, axes for evaluating agents is this is environment complexity is um, one of the most important axes.
  133. 14:51How complex, how realistic and dynamic are the environments uh, the agents operating in.
  134. 14:57The next is autonomy horizon.
  135. 14:59Um, are agents being tested and evaluated at the lengths and the horizon lengths in the way people actually want to use agents?
  136. 15:06Um, are they making safe and good decisions by themselves?
  137. 15:10And can they actually improve um, their judgment as a co-pilot over time?
  138. 15:16And finally, output complexity.
  139. 15:18We want to capture the wide range of outputs in our day-to-day work.
  140. 15:22Um, and I would say that this is currently under explored.
  141. 15:26New benchmarks are coming up in this direction, but uh still I see a big primary focus on um text artifacts and creating more rigorous evaluations and these settings is a big opportunity.
  142. 15:42Progress is being made here.
  143. 15:45So, on that note, um I'm going to advertise our open benchmarks grants, which funded this project.
  144. 15:52And this is a multi-million dollar commitment to producing open benchmarks like this.
  145. 15:58We've had a lot of success agent, last exam, judgment bench, um others are coming out and this is um really accelerating our ability to measure the frontier and shape the frontier.
  146. 16:14So, to apply uh check out our website.
  147. 16:18Um you'll go through a submission selection review process, develop, and then finally publication, launch, um and promotion.
  148. 16:27And I also want to call out that we're hiring in professional research, um you name it, engineers, and um yeah, check that out.
  149. 16:40You can check out our website and finally, thank you so much for attending.
  150. 16:47Um you can use this QR code to see the blog as well as pointers to all the artifacts that released on GitHub, Hugging Face.
  151. 16:56Yeah, thank you all.