跪拜 Guibai
← All articles
AI Programming

A Private AI Wrong-Question Notebook Closes the Loop from Photo to Practice Paper

By 雪庭 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The engineering around the model, not the model itself, determines whether an AI tool survives daily use. The quality chain, human-in-the-loop review, and data-as-files approach in this project transfer directly to any AI application handling messy real-world input; the token-saving shift to on-demand vector graphics is a concrete lesson for cost-sensitive pipelines.

Summary

A private AI system for a middle-schooler's math errors turns a photo of a worksheet into a structured, human-verified question bank. The workflow runs: photograph multiple questions on a page, a vision model transcribes them into LaTeX (handwriting is only marked, not transcribed), then a human reviews each card against the original image, selects which to store, tags the error cause (careless, doesn't know, other), and assigns a knowledge point from a textbook-derived tree. After submission, the question goes through a quality chain: dedup (stem normalization, ≥92% similarity means duplicate), independent solving by a second model to verify the printed answer, and chapter/difficulty/knowledge-point analysis. The bank feeds two practice modes: a single-question loop that auto-grades and recommends archiving after 3 consecutive correct answers, and a full-paper mode that batch-grades a selection and aggregates wrong-question knowledge points.

Three design decisions stand out. Data lives as human-readable JSON files with atomic writes and git versioning, which turned out to be a life-saver when a test accident overwrote the question bank. SVG vector graphics generation, initially the default for geometry, became on-demand because it consumed the most tokens and time (1–3 LLM calls per question plus retries); photo crops are now the default at 0 tokens. And human review is treated as the product's core, not a transitional step, because photo transcription is too unreliable for full automation. The builder went through 12 iterations driven by real usage over 3 days of initial development, and the system is now used daily at home.

Takeaways
— All AI-generated questions must pass a three-step quality chain: geocheck (geometry numeric validation), verify_answers (independent solving), and export_paper (vector PDF).
— Duplicate detection normalizes question stems (strips LaTeX commands, punctuation, whitespace) and flags ≥92% similarity as a duplicate.
— Printed answers are never trusted: a separate model independently solves every question, and conflicts go to needs_review.
— Vector SVG generation was the most token-expensive step (1–3 LLM calls per question plus retries); v0.6 made photo crops the default (0 tokens) with SVG on demand, saving over half the overhead.
— Data is stored as human-readable JSON with atomic writes and .bak backups, git-versioned; a test accident that overwrote the bank was recovered via backup and git.
— After 3 consecutive correct answers, the system suggests archiving the question to free attention from mastered content.
— DeepSeek's thinking chain consumed max_tokens, returning empty content with finish_reason=length; a degradation ladder (json_object → no-thinking retry → plain) cut latency from 645s to 16s.
— The textbook knowledge base was built by transcribing 201 pages of a Zhejiang Education grade 8 math textbook into structured JSON via a vision model.
Conclusions

Human review stays the product's core because photo transcription is too unreliable for full automation. The 80/20 split of AI grunt work to human judgment is a realistic division for many consumer AI tools.

Storing the question bank as versioned files rather than SQLite turned an accident into a recovery story. For personal or small-scale data, git becomes an audit trail and rollback mechanism that a database doesn't naturally offer.

Switching SVG generation from default to on-demand shows that 'smart' processing should be opt-in when it costs tokens and latency. The measured 645s→16s improvement after turning off DeepSeek's thinking chain is the same principle applied to reasoning.

The three-consecutive-correct archive rule implicitly builds spaced repetition, and periodic review reminders—planned as the next step—would complete that loop on top of the existing practice modes.

Concepts & terms
geocheck
A validation step that checks whether AI-generated geometry figures' numeric values are consistent before the figure is accepted. It runs a loop that may retry if the numbers don't match.
verify_answers
An independent solving step where a separate model solves a question to cross-check the printed answer in the photo. Discrepancies are logged and the question goes to needs_review.
needs_review
A queue for questions that fail verification or that a human hasn't confirmed. It's the fallback state for anything that doesn't pass the quality chain cleanly.
EXIF orientation
Metadata in photos that records how the camera was rotated. Misinterpreting it can rotate crops or misalign manual selections; the fix is to unify all steps to a single upright coordinate space.
knowledge tree
A hierarchical list of topics extracted from a textbook (201 pages transcribed into structured JSON) that constrains what knowledge points an LLM can tag, ensuring filters match actual content.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗