About
## Challenges we ran into
- **The teacher model hallucinated too.** Even with its output format enforced, our 7B teacher fabricated a quote or figure in 9.2% of its answers and answered 76% of the "trap" questions it should have refused. We built a word-for-word filter: only answers whose every quote and figure appear verbatim in the policy were kept (253 of 600), so none of the bad ones reached training.
- **Our first fine-tuned model got worse.** AuditKIT's question-by-question comparison showed a significant drop: the model left its summary empty in 94 of 94 answers. We traced it to our answer format, not the training. The summary was optional, and one field asked for labels the prompt never defined. The teacher copied both problems and training amplified them. We made the summary required and enforced it during decoding with XGrammar, removed the undefined field, and added usability checks. The summaries came back (0% → 97.9%).
- **Everything had to fit on one free T4 (16 GB).** SGLang and training can't share the GPU, the T4 has no bf16, and two models can't be served at once. We used 4-bit LoRA with fp16, stopped SGLang before each training run, merged adapters on the GPU in a separate process, and precomputed the untrained model's answers for the before/after comparison.
- **Colab kept disconnecting.** Every stage saves to Google Drive and is skipped when its output exists, so a full 6–8 hour run resumes where it stopped. One disconnect was our own fault: the pattern we used to restart the web app (`web.app`) also matched Colab's internal `/datalab/web/app.js`, so killing it took down the runtime. We switched to exact patterns.
- **The live demo needs an active GPU.** The website runs only while a Colab GPU session is active, and the public link changes on every restart. We wrote a demo-only notebook that brings the site back in about 10–15 minutes.
- **Indian legal PDFs are messy.** Footnote markers glued to clause numbers, cross-references wrapping onto new lines, page watermarks and bilingual Hindi/English gazettes all broke clause splitting, and with it the citations. We wrote a clause chunker that handles each case, so every citation points at a real clause number.
- **SGLang on an older GPU.** FlashInfer compiles kernels at runtime on the T4 (sm_75), which needed the right build tools on the path, and AWQ needed the plain `awq` kernel instead of `awq_marlin`. CuratorKIT's schema filter also rejected every raw clause until we configured its required fields.
📄 Full analysis in our [technical report](https://github.com/sourav-101/Factualis/blob/main/docs/Factualis_Technical_Report.pdf).
## The problem it solves
**Compliance answers you can actually check.**
Bank staff ask compliance questions all day: *"Does this transfer need review? Who approves it? How long do we keep the records?"* General-purpose AI assistants answer confidently from what they already know, quoting a US USD 10,000 rule, a five-year retention period or an approver the bank doesn't have. In compliance, a fluent wrong answer is a breach.
**Factualis** answers only from the bank's own policy documents:
- **Every answer is grounded.** It finds the six most relevant policy clauses and the model must answer from those, not from memory.
- **Every claim is verified.** Each quote and figure is checked word for word against the source text by a program, with no second AI acting as judge. One click shows the original clause with the quote highlighted.
- **It says when it doesn't know.** If the policy doesn't cover a question, it answers "No answer in policy" and shows the closest text it found, instead of guessing.
- **Verified mode** holds back any answer containing something the checker couldn't find, so nothing unverified reaches the user.
- **It runs locally and privately.** A 3B model on a single T4 GPU, served with SGLang, so confidential policy documents never leave the bank's own machine.
**Results** on 94 hand-verified questions: - SGLang structured output took checkable answers from 0% to 100%. - RadixAttention made the first token 9.3× faster. - Fine-tuning with SFT + DPO cut wrong refusals by 38% (p = 0.02) and halved unsupported claims per answer.
The same approach works for any organisation with a policy library: banks, insurers, HR and legal teams.
Screenshots
Team
From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.











