SPB Git forge

spb/wp13_uqo

Public
3commits 1branches 1releases
1.2 MBsize
maindefault branch
10 min agolast push
TeX 93.9% Python 6%
10.6 KB

# 🤖 VQuant: An Agentic Large Language Model Architecture for Automated Quantitative Financial Analysis and Document Generation

UQO Working Paper No. 13 — Reasoning-Augmented Tool Orchestration, In-Loop Numerical Computation, and Multi-Format Reporting

Paper Type Platform Institution Author

TL;DR — VQuant is a deployed web platform that turns a natural-language request into a quantitative financial report in which every number comes from live data retrieval or auditable code rather than from the model. This is a design-science system description, audited line by line against the platform's source code (spbgit vquant.git, commit e2a148a, 2026-10-02): a recursive, batched, streaming tool-calling loop over 245 schema-defined tools (two market-data providers, 249 typed wrappers over 233 endpoint paths; three web-research services; a Python sandbox pre-loading 29 packages), a three-stage context-management procedure (3,000/15,000-char truncation at execution, 5,000-char re-send cap, adaptive summarisation at 10^5 tokens keeping the last 5 messages), a single-call computation convention, and a document pipeline (PDF via Puppeteer+KaTeX, DOCX via Pandoc, Beamer via a second model call + two pdflatex passes, live-formula XLSX). No empirical evaluation is reported (no accuracy, hallucination, latency or cost measurements); a pre-registered evaluation protocol is specified as future work.


# 📌 Status

Item Value
Version 1.1 (October 2026) — revised 2026-10-17 (editorial-board review; docs/REVIEW-REPORT.md, docs/CHANGELOG-REVISION.md). v1.0 = June 2026 (docs/main_pre-revision-20261017.pdf, 28 p.)
SSRN not yet submitted
Journal not yet submitted; candidate venues Journal of Financial Data Science, Decision Support Systems, Expert Systems with Applications — only after the evaluation protocol of §6.6 has been executed
Code & data design/system paper — no empirical pipeline. The platform's source code lives in the spbgit repository vquant.git; the paper describes commit e2a148a (2026-10-02). The audit script and its outputs are in docs/verify/

# 🎯 What this paper does

Large language models are fluent in financial discourse, but fluency does not guarantee numerically rigorous, reproducible or citable analysis. This paper describes the architecture of VQuant, a platform that couples a reasoning-capable LLM with a deterministic execution substrate, under the principle the model plans and synthesises, auditable code computes. It is written as a design-science contribution (Hevner et al. 2004; Gregor & Hevner 2013): a situated implementation plus a demonstration, with the evaluation step specified but not performed.

Four mechanisms are documented at implementation level, with their actual constants, and audited against the code (Appendix E maps every claim to a source file):

  1. an agentic orchestration loop over 245 tools (recursive tool-calling, batches of 5 with 500 ms spacing, tool-use/tool-result pairing, prompt-level routing by request complexity);
  2. a three-stage context-management procedure (per-result truncation at execution, re-send cap, adaptive summarisation under a 10^5-token budget) and a token-accounting correction (max of provider count and a local BPE count — an approximation, not an exact count);
  3. a single-call computation convention (data → estimation → figures in one sandboxed Python execution; process-isolated child, 90 s timeout, figure sweep at 150 dpi);
  4. a document pipeline (PDF, DOCX, Beamer, live-formula XLSX from one Markdown artifact).

The revision corrected several statements of v1.0 that the code audit contradicted: tool count, tokenizer, reachability of the pre-built numerical routines (only the option pricer is in the catalogue), the model layer (now multi-provider), and three features (SSO, daily caps, bring-your-own-keys) that do not exist in any committed version.

# 🏆 Headline results

There are no empirical results. The table lists verified design facts (commit e2a148a).

Object Value (audited)
Tools exposed to the model 245 schema-defined tools (17 families, Table 3)
Market-data wrappers 249 typed functions over 233 endpoint paths (FMP) + 8 EODHD tools
Web-research tools 14 (Firecrawl 7, Tavily 5, Exa 2)
Sandbox packages attempted at start-up 29 (platform docs say 17)
Loop constants batches of 5, 500 ms; truncation 3,000/15,000 chars; re-send cap 5,000; τ = 10^5 tokens, k = 5
Model layer Anthropic reference path (default claude-fable-5, adaptive thinking on 5 models, 64,000-token cap, temperature 1); OpenAI-compatible adapter limited to the first 128 tools
Output formats from one artifact PDF, DOCX, Beamer, XLSX (live formulas)
Measurements of accuracy, hallucination, latency, cost none (protocol in §6.6, not executed)

# 🗂 Repository layout

text
vquant-llm-quant-platform/
├── paper/                    # main.tex + sections/ + figures/ (TikZ diagrams) + tables/ + appendix/ → main.pdf
│   ├── figures/              # architecture, loop, context, sandbox, streaming, docpipeline (TikZ)
│   └── tables/               # tools (generated by docs/verify/audit_vquant_code.py), models, events, robustness (= design rationale)
└── docs/                     # REVIEW-REPORT.md, CHANGELOG-REVISION.md, main_pre-revision-20261017.pdf, verify/ (audit script + JSON)

No src/, scripts/ or data/: the paper has no empirical pipeline. docs/verify/audit_vquant_code.py <clone of vquant.git> regenerates paper/tables/tools.tex and the code facts used in the text.

# 🚀 Quick start

bash
cd paper && make      # latexmk → main.pdf (pdflatex + bibtex, TikZ diagrams compiled inline)

# 🗃 Data

Not applicable. The paper describes a software system; the platform itself (TypeScript/Python) is maintained in the spbgit repository vquant.git and deployed on the MacLustr cluster.

# 🔬 Methodology

  1. Architecture description — components, data layer, model layer, as implemented at commit e2a148a (§3).
  2. Mechanism specification — transport, recursive loop (Algorithm 1), batching, routing, three-stage context management (Algorithm 2), token correction, single-call convention (§4).
  3. Execution substrate, document pipeline, illustrative walk-through — no numbers reported (§5).
  4. Design rationale, threats to validity, reproducibility, proposed evaluation protocol (not executed) — task suite, metrics (incl. unsupported-number rate), ablations, baselines, controls (§6).
  5. Appendix — prompt structure, persistence schema, numerical closed forms, event types, and the claim-by-claim audit table against the code.

# 🖼 Figures & tables inventory

Figure (TikZ) Content
figures/architecture.tex end-to-end platform architecture
figures/loop.tex recursive tool-calling loop
figures/context.tex two-stage context management
figures/sandbox.tex inter-process Python sandbox
figures/streaming.tex SSE event dispatch
figures/docpipeline.tex unified document pipeline

Tables (paper/tables/*.tex): tool catalogue (generated), model layer, streaming events, design rationale; appendix tables: persisted entities, code audit (longtable).

# ⚠️ Limitations

  • Design-science description only: no evaluation (accuracy, hallucination rate, latency, cost, ablations, baselines). The protocol of §6.6 is pre-registered in the text but has not been run.
  • Describes one commit (e2a148a, 2026-10-02) of a system that keeps changing; counts and constants are facts about that commit.
  • Outputs are not strictly reproducible (temperature 1, no seeds, model-authored code); the design is.
  • Known defects surfaced by the audit and not yet fixed in the code: no recursion-depth bound; single $3/$15 price schedule for all models; six numerical handlers unreachable (not in the catalogue) while the prompt still advertises two of them; the sandbox is process isolation, not a security boundary.
  • Reproducing the platform requires the private vquant.git code base and API keys.

# 📝 Citation

bibtex
@techreport{boucher2026vquant,
  author      = {Boucher, Simon-Pierre},
  title       = {VQuant: An Agentic Large Language Model Architecture for Automated Quantitative Financial Analysis and Document Generation},
  institution = {Universit\'e du Qu\'ebec en Outaouais, D\'epartement des sciences administratives},
  type        = {Working Paper},
  number      = {13},
  year        = {2026},
  month       = {October},
  note        = {Version 1.1}
}

# 👤 Author & contact

Simon-Pierre Boucher — Département des sciences administratives, Université du Québec en Outaouais (UQO), Gatineau, QC. 📧 simon-pierre.boucher@uqo.ca

# 🗒 Notes

  • Revision 2026-10-17 (v1.1): full editorial-board review — docs/REVIEW-REPORT.md (diagnosis, methodology verdicts, literature, maturity) and docs/CHANGELOG-REVISION.md (every corrected statement with its evidence in the code, references added, items not executed). Pre-revision state: git tag pre-revision-20261017, docs/main_pre-revision-20261017.pdf. Bibliography 20 → 46 entries, all verified (Crossref, arXiv, conference proceedings; one entry flagged as withdrawn by its authors). Sections 5 and 6 were renamed from "Results"/"Performance, Reliability, and Security" to "Execution Substrate … and an Illustrative Walk-Through" and "Design Rationale, Threats to Validity, and a Proposed Evaluation".
  • Numbering: first circulated as “Working Paper No. 10” (June 2026); renumbered 13 on 2026-10-17 because No. 10 is The Assessment Gap in Quebec (see Recherche-UQO/HARMONISATION.md).
  • Cover date normalised from “June 13, 2026” to “June 2026” (harmonisation), then “October 2026” (revision).
  • The VQuant platform code is not in this repository (spbgit vquant.git); docs/verify/ contains the audit script and its JSON outputs, not the code.