SPB Git forge

spb/wp13_uqo

Public
3commits 1branches 1releases
1.2 MBsize
maindefault branch
1 h agolast push
TeX 93.9% Python 6%
10.6 KB · 158 lines markdown
Rendered Raw Blame History
1<!-- Author: Simon-Pierre Boucher — simon-pierre.boucher@uqo.ca -->2# 🤖 VQuant: An Agentic Large Language Model Architecture for Automated Quantitative Financial Analysis and Document Generation34**UQO Working Paper No. 13** — *Reasoning-Augmented Tool Orchestration, In-Loop Numerical Computation, and Multi-Format Reporting*56[![Paper](https://img.shields.io/badge/paper-PDF%20(41%20p.)-b31b1b?logo=latex&logoColor=white)](paper/main.pdf)7[![Type](https://img.shields.io/badge/type-system%20%2F%20methodology%20paper-4051b5)](paper/main.tex)8[![Platform](https://img.shields.io/badge/platform-VQuant%20(spbgit%20vquant.git)-4051b5)](#-data)9[![Institution](https://img.shields.io/badge/UQO-D%C3%A9pt.%20des%20sciences%20administratives-16365c)](https://uqo.ca)10[![Author](https://img.shields.io/badge/author-Simon--Pierre%20Boucher-16365c)](mailto:simon-pierre.boucher@uqo.ca)1112> **TL;DR** — VQuant is a deployed web platform that turns a natural-language request into a13> quantitative financial report in which every number comes from live data retrieval or auditable14> code rather than from the model. This is a **design-science system description, audited line by15> line against the platform's source code** (spbgit `vquant.git`, commit `e2a148a`, 2026-10-02):16> a recursive, batched, streaming tool-calling loop over **245 schema-defined tools** (two17> market-data providers, 249 typed wrappers over 233 endpoint paths; three web-research services;18> a Python sandbox pre-loading 29 packages), a **three-stage context-management procedure**19> (3,000/15,000-char truncation at execution, 5,000-char re-send cap, adaptive summarisation at20> 10^5 tokens keeping the last 5 messages), a **single-call computation convention**, and a21> document pipeline (PDF via Puppeteer+KaTeX, DOCX via Pandoc, Beamer via a second model call +22> two pdflatex passes, live-formula XLSX). **No empirical evaluation is reported** (no accuracy,23> hallucination, latency or cost measurements); a pre-registered evaluation protocol is specified24> as future work.2526---2728## 📌 Status2930| Item | Value |31|---|---|32| 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.) |33| SSRN | not yet submitted |34| 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** |35| 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/` |3637## 🎯 What this paper does3839Large language models are fluent in financial discourse, but fluency does not guarantee40numerically rigorous, reproducible or citable analysis. This paper describes the **architecture**41of VQuant, a platform that couples a reasoning-capable LLM with a deterministic execution42substrate, under the principle *the model plans and synthesises, auditable code computes*. It is43written as a design-science contribution (Hevner et al. 2004; Gregor & Hevner 2013): a situated44implementation plus a demonstration, with the evaluation step specified but not performed.4546Four mechanisms are documented at implementation level, with their actual constants, and audited47against the code (Appendix E maps every claim to a source file):48491. an **agentic orchestration loop** over 245 tools (recursive tool-calling, batches of 5 with50   500 ms spacing, tool-use/tool-result pairing, prompt-level routing by request complexity);512. a **three-stage context-management procedure** (per-result truncation at execution, re-send52   cap, adaptive summarisation under a 10^5-token budget) and a **token-accounting correction**53   (max of provider count and a local BPE count — an approximation, not an exact count);543. a **single-call computation convention** (data → estimation → figures in one sandboxed Python55   execution; process-isolated child, 90 s timeout, figure sweep at 150 dpi);564. a **document pipeline** (PDF, DOCX, Beamer, live-formula XLSX from one Markdown artifact).5758The revision corrected several statements of v1.0 that the code audit contradicted: tool count,59tokenizer, reachability of the pre-built numerical routines (only the option pricer is in the60catalogue), the model layer (now multi-provider), and three features (SSO, daily caps,61bring-your-own-keys) that do not exist in any committed version.6263## 🏆 Headline results6465There are **no empirical results**. The table lists verified design facts (commit `e2a148a`).6667| Object | Value (audited) |68|---|---|69| Tools exposed to the model | 245 schema-defined tools (17 families, Table 3) |70| Market-data wrappers | 249 typed functions over 233 endpoint paths (FMP) + 8 EODHD tools |71| Web-research tools | 14 (Firecrawl 7, Tavily 5, Exa 2) |72| Sandbox packages attempted at start-up | 29 (platform docs say 17) |73| Loop constants | batches of 5, 500 ms; truncation 3,000/15,000 chars; re-send cap 5,000; τ = 10^5 tokens, k = 5 |74| 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 |75| Output formats from one artifact | PDF, DOCX, Beamer, XLSX (live formulas) |76| Measurements of accuracy, hallucination, latency, cost | none (protocol in §6.6, not executed) |7778## 🗂 Repository layout7980```81vquant-llm-quant-platform/82├── paper/                    # main.tex + sections/ + figures/ (TikZ diagrams) + tables/ + appendix/ → main.pdf83│   ├── figures/              # architecture, loop, context, sandbox, streaming, docpipeline (TikZ)84│   └── tables/               # tools (generated by docs/verify/audit_vquant_code.py), models, events, robustness (= design rationale)85└── docs/                     # REVIEW-REPORT.md, CHANGELOG-REVISION.md, main_pre-revision-20261017.pdf, verify/ (audit script + JSON)86```8788No `src/`, `scripts/` or `data/`: the paper has no empirical pipeline. `docs/verify/audit_vquant_code.py <clone of vquant.git>`89regenerates `paper/tables/tools.tex` and the code facts used in the text.9091## 🚀 Quick start9293```bash94cd paper && make      # latexmk → main.pdf (pdflatex + bibtex, TikZ diagrams compiled inline)95```9697## 🗃 Data9899Not applicable. The paper describes a software system; the platform itself (TypeScript/Python)100is maintained in the spbgit repository `vquant.git` and deployed on the MacLustr cluster.101102## 🔬 Methodology1031041. **Architecture description** — components, data layer, model layer, as implemented at commit `e2a148a` (§3).1052. **Mechanism specification** — transport, recursive loop (Algorithm 1), batching, routing, three-stage context management (Algorithm 2), token correction, single-call convention (§4).1063. **Execution substrate, document pipeline, illustrative walk-through** — no numbers reported (§5).1074. **Design rationale, threats to validity, reproducibility, proposed evaluation protocol (not executed)** — task suite, metrics (incl. unsupported-number rate), ablations, baselines, controls (§6).1085. **Appendix** — prompt structure, persistence schema, numerical closed forms, event types, and the claim-by-claim **audit table against the code**.109110## 🖼 Figures & tables inventory111112| Figure (TikZ) | Content |113|---|---|114| `figures/architecture.tex` | end-to-end platform architecture |115| `figures/loop.tex` | recursive tool-calling loop |116| `figures/context.tex` | two-stage context management |117| `figures/sandbox.tex` | inter-process Python sandbox |118| `figures/streaming.tex` | SSE event dispatch |119| `figures/docpipeline.tex` | unified document pipeline |120121Tables (`paper/tables/*.tex`): tool catalogue (generated), model layer, streaming events, design rationale; appendix tables: persisted entities, code audit (longtable).122123## ⚠️ Limitations124125- 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.126- Describes one commit (`e2a148a`, 2026-10-02) of a system that keeps changing; counts and constants are facts about that commit.127- Outputs are not strictly reproducible (temperature 1, no seeds, model-authored code); the design is.128- 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.129- Reproducing the *platform* requires the private `vquant.git` code base and API keys.130131## 📝 Citation132133```bibtex134@techreport{boucher2026vquant,135  author      = {Boucher, Simon-Pierre},136  title       = {VQuant: An Agentic Large Language Model Architecture for Automated Quantitative Financial Analysis and Document Generation},137  institution = {Universit\'e du Qu\'ebec en Outaouais, D\'epartement des sciences administratives},138  type        = {Working Paper},139  number      = {13},140  year        = {2026},141  month       = {October},142  note        = {Version 1.1}143}144```145146## 👤 Author & contact147148**Simon-Pierre Boucher** — Département des sciences administratives,149Université du Québec en Outaouais (UQO), Gatineau, QC.150📧 [simon-pierre.boucher@uqo.ca](mailto:simon-pierre.boucher@uqo.ca)151152## 🗒 Notes153154- **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".155- 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`).156- Cover date normalised from “June 13, 2026” to “June 2026” (harmonisation), then “October 2026” (revision).157- 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.158