AI tutoring could markedly improve learning outcomes for students in developing regions such as Vietnam, yet the two obvious paths both fall short. Cloud assistants such as ChatGPT route sensitive student data to foreign servers---violating data-sovereignty laws such as Vietnam's Decree 53---and, pre-trained on Western-centric corpora, are not organized around the national textbook curriculum, so their knowledge of local content is unsystematic and frequently hallucinated. Self-hosting an open model keeps data on-premise but hits a two-fold wall: post-training quantization (AWQ, GPTQ) tames the static weight footprint, yet the dynamic KV cache and prefill latency of long tutoring contexts still cause out-of-memory failures and slow responses on consumer GPUs, while the model keeps hallucinating on region-specific material. We present DeepEdu-v1, an AI-tutoring system for Vietnamese education built on SCALE (Self-improving Context-Aware Learning Engine), a framework with two innovations. First, a long-context inference engine amortizes token selection from per-sub-chunk to per-cluster granularity; on long-context retrieval it issues x7.7 fewer retrieval calls than a state-of-the-art selective-attention baseline, cutting prefill latency (TTFT) by roughly 35% while matching or improving task accuracy. Second, a self-improving agentic layer continuously curates a verified playbook from past interactions instead of fine-tuning, a design intended to progressively reduce reliance on dominant-language priors as trustworthy local knowledge accumulates. In its deployed configuration, DeepEdu achieves a nearly x2 TTFT speedup over standard vLLM serving and lifts agentic accuracy from 70.0% to 79.5% on complex tasks, with the strongest per-track gains across financial-reasoning and interactive-agent benchmarks.
Figures & tables
Direction
On-prem.
Long-ctx
Self-impr.
Local.
Quantization [ 9 , 10 ]
✓
–
–
–
Sparse long-context [ 55 , 51 ]
–
✓
–
–
Agentic context [ 65 , 62 ]
(✓)
–
✓
–
LRL adaptation [ 13 , 6 ]
–
–
–
✓
DeepEdu (ours)
✓
✓
✓
✓
TABLE I : Positioning of DeepEdu against representative prior directions. ✓: directly addressed; (✓): partial; –: not addressed. Columns: on-premise/data-sovereignty fit, long-context efficiency, self-improvement without fine-tuning, and localization.
Layer
Mean
Min
Max
P10
Median
P90
Layer 0
0.938
0.442
1.000
0.887
0.943
0.982
Layer 6
0.956
0.797
1.000
0.934
0.958
0.977
Layer 13
0.925
0.329
0.995
0.876
0.934
0.969
Layer 20
0.918
0.580
0.996
0.868
0.924
0.963
Layer 27
0.943
0.434
1.000
0.870
0.959
0.987
TABLE II : Distribution of consecutive sub-chunk cosine similarity cos(vi,vi+1) , aggregated across six long-context tasks (Qwen2-7B-Instruct, L=512 ). Consecutive sub-chunks share nearly identical query representations at every layer, with the low-similarity tail confined to rare semantic boundaries.
Layer
θ=0.95
θ=0.97
θ=0.99
θ=0.999
Layer 0
4025
4025
4013
3446
Layer 6
4025
4021
3904
1616
Layer 13
3988
3699
1947
0 829
Layer 20
3964
3260
1628
0 694
Layer 27
4017
3992
3695
1509
TABLE III : Mean cluster size (in tokens) at each threshold θ . Higher θ produces smaller clusters as the mechanism increasingly detects semantic boundaries; the effect is most pronounced at middle layers where semantic discrimination is highest. Maximum cluster size is Lmax=4096 .
Cluster size
θ=0.95
θ=0.97
θ=0.99
θ=0.999
1 block
0 0.6%
0 2.4%
36.7%
82.6%
2 blocks
0 0.9%
0 7.2%
19.2%
0 9.2%
3 blocks
0 1.4%
0 8.2%
11.0%
0 3.7%
4 blocks
0 1.5%
0 8.0%
0 8.2%
0 2.1%
5–7 blocks
0 1.3%
12.4%
0 9.3%
0 2.0%
8 blocks (max)
94.2%
61.7%
15.5%
0 0.5%
TABLE IV : Distribution of cluster sizes (in L -blocks) at Layer 20 under varying threshold θ . At θ=0.95 , 94% of clusters reach the maximum size of 8 blocks; at θ=0.999 , the mechanism reverts to single-block selection 83% of the time.
θ
Min
Median
Mean
Max
0.95
88.2
97.9
96.8
100.0
0.97
90.5
98.6
97.7
100.0
0.99
93.1
99.3
98.6
100.0
TABLE V : Top- k overlap ratio ρ (%) between the anchor query and per-sub-chunk retrieval at varying similarity thresholds θ , with k=8192 . Higher θ yields tighter overlap, confirming that anchor-driven retrieval faithfully approximates per-sub-chunk retrieval in the operating regime of our mechanism.
Fig. 1 : Evaluation-only RAE study on Formula. All conditions use the same fixed Playbook, Qwen3-4B-Instruct-2507, and 200 test examples. Semantic top- 10 retrieval is both more accurate and faster than the full-Playbook condition; random top- 10 is a length-matched control.
Fig. 2 : Recurring failure observations in the 500-task offline Formula run, which produces 126 Ground-Truth-verified failures. Panel (a) summarizes these verified failures, and panel (b) counts, for each failure observation, how many later failure observations are semantically related to it.
Fig. 3 : SCALE pipeline comparison. As the agentic layer continuously curates an evolving playbook (10K → 200K tokens), the choice of inference engine determines deployment feasibility. Without the long-context engine, prefill latency grows quadratically and accuracy degrades on noisy long contexts, eventually triggering out-of-memory failures. SCALE’s cluster-level sparse selection maintains low latency and improves accuracy as the playbook accumulates richer localized knowledge. Latency and accuracy numbers are illustrative; concrete benchmarks are reported in Section VI .
Fig. 4 : Similarity Chunk Rolling (SCR) pipeline. Consecutive query sub-chunks with high mutual similarity are grouped into clusters via anchor-based formation; SCR issues a single top- k retrieval per cluster and computes sparse attention over the whole cluster in one parallel forward pass, amortizing selection from per-sub-chunk to per-cluster granularity.
Method
Code.D
R.KV
En.Dia
Math.F
Qwen2-7B-Instruct [ 16 ]
28.2
19.0
0 8.5
19.7
NTK [ 34 ]
24.9
59.8
0 7.5
27.7
SelfExtend [ 72 ]
0 8.1
0 0.0
0 5.0
0 2.3
StreamingLLM [ 48 ]
27.9
0 2.4
0 3.5
19.4
InfLLM [ 51 ]
27.4
0 5.4
0 7.5
24.0
TokenSelect [ 55 ]
26.7
91.0
10.0
24.0
TABLE VI : Per-task accuracy (%) on representative InfiniteBench tasks (Qwen2-7B-Instruct). R.Num and R.PK are saturated at 100% and omitted here; the full six-task, nine-configuration grid is in Table XII . Best per column in bold.
Method
Code.D
R.KV
En.Dia
Math.F
TokenSelect
8.8
13.2
7.7
8.7
θ=0.95 , Lmax=1024
6.7
0 9.9
6.0
6.6
θ=0.95 , Lmax=2048
5.9
0 8.7
5.3
5.9
θ=0.95 , Lmax=4096
5.7
0 8.3
5.1
5.7
θ=0.99 , Lmax=1024
7.3
0 9.9
6.2
6.7
TABLE VII : Per-task TTFT latency (s) on representative InfiniteBench tasks. SCR delivers roughly a 35% latency reduction over the TokenSelect baseline (top- k=8192 ), with the largest gains on long-context retrieval tasks. The complete nine-configuration grid over all six tasks appears in Table XIII . Best (lowest) per column in bold.
Fig. 5 : Per-sample prefill time by stage on InfiniteBench R.KV (Qwen2-7B-Instruct; separate instrumented run, n=30 ). Overall TTFT falls 13.1 s →8.3 s ( −37% ); almost the entire reduction comes from the token-retrieval stage, while attention compute is nearly unchanged.
Method
4K
8K
16K
32K
64K
128K
TokenSelect
96.53
97.72
95.16
78.69
69.09
64.78
θ=0.95 , Lmax=1024
96.75
97.59
95.28
78.53
68.66
64.88
θ=0.95 , Lmax=4096
96.69
97.81
95.97
77.81
69.72
65.28
TABLE VIII : Average accuracy (%) on RULER across eight needle-in-a-haystack tasks at varying context lengths. SCR variants preserve or slightly improve over the TokenSelect baseline at every context length.
Method
4K
8K
16K
32K
64K
128K
TokenSelect
0.52
0.65
1.94
3.17
5.27
9.89
θ=0.95 , Lmax=1024
0.53
0.65
1.88
2.94
4.57
8.16
θ=0.95 , Lmax=4096
0.52
0.62
1.75
2.64
3.90
6.64
TABLE IX : Average TTFT latency (s) on RULER at varying context lengths. SCR achieves substantial latency reduction at long contexts, with the gap widening as context length grows.
Method
RAE
FMB
Adv.
FiNER Acc ↑
Formula Acc ↑
Average ↑
Origin
–
–
–
51.3
70.0
60.7
+ RAE
✓
–
–
47.6
77.5
62.6
+ Adversarial
✓
–
✓
52.1
79.5
65.8
+ FMB (DeepEdu)
✓
✓
✓
52.9
73.0
63.0
TABLE X : Incremental ablation of the agentic mechanisms on Formula and FiNER using Ground Truth labels. Mechanisms are added cumulatively on top of the Origin Playbook; all runs use Qwen3-4B-Instruct-2507, seed 42, and identical training settings. Average is the mean of the two accuracies; the final row is the full configuration DeepEdu deploys. Best per column in bold.
Method
RAE
FMB
Adv.
Test-Normal
Test-Challenge
Average
TGC ↑
SGC ↑
TGC ↑
SGC ↑
↑
Origin
–
–
–
20.8
8.9
6.7
0.7
9.3
+ RAE
✓
–
–
20.2
12.5
8.2
0.7
10.4
+ Adversarial
✓
–
✓
20.2
7.1
6.2
2.2
8.9
+ FMB (DeepEdu)
✓
✓
✓
22.0
10.7
7.4
1.4
10.4
TABLE XI : Incremental ablation of the agentic mechanisms on AppWorld using Ground Truth environment outcomes. Mechanisms are added cumulatively on top of Origin; TGC and SGC are reported for the normal and challenge splits, and Average is the mean of the four reported metrics. The final row is the full configuration DeepEdu deploys. Best per column in bold.
Fig. 6 : Aggregate inference statistics for ACE on the AppWorld normal and challenge splits
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Method
Code.D
R.KV
En.Dia
Math.F
R.Num
R.PK
Qwen2-7B [ 16 ]
28.2
19.0
0 8.5
19.7
28.6
28.8
NTK [ 34 ]
24.9
59.8
0 7.5
27.7
97.5
99.2
SelfExtend [ 72 ]
0 8.1
0 0.0
0 5.0
0 2.3
0 0.0
0 0.0
StreamingLLM [ 48 ]
27.9
0 2.4
0 3.5
19.4
0 5.1
0 5.1
InfLLM [ 51 ]
27.4
0 5.4
0 7.5
24.0
72.2
70.3
TokenSelect [ 55 ]
26.7
91.0
10.0
24.0
100.0
100.0
Appendix
TABLE XII : Full per-task accuracy (%) on InfiniteBench (Qwen2-7B-Instruct) for all nine SCR configurations and the baselines. Best per column in bold; R.Num / R.PK are saturated for the strong methods and left unbolded.
Method
Code.D
R.KV
En.Dia
Math.F
R.Num
R.PK
TokenSelect
8.8
13.2
7.7
8.7
9.4
9.3
θ=0.95 , Lmax=1024
6.7
9.9
6.0
6.6
7.1
7.0
θ=0.95 , Lmax=2048
5.9
8.7
5.3
5.9
6.3
6.3
θ=0.95 , Lmax=4096
5.7
8.3
5.1
5.7
6.1
6.0
θ=0.97 , Lmax=1024
6.7
9.8
6.0
6.6
7.0
7.0
θ=0.97 , Lmax=2048
6.1
8.7
5.4
5.9
6.4
6.4
Appendix
TABLE XIII : Full per-task TTFT latency (s) on InfiniteBench for all nine SCR configurations. Best (lowest) per column in bold.
Deploying high-fidelity AI tutors in schools is often blocked by the Resource Curse -- the need for expensive cloud GPUs and massive data engineering. In this practitioner report, we present a replicable Standard Operating Procedure that breaks this barrier. Using a Vision-Language Model data cleaning strategy and a novel Shadow-RAG architecture, we localized a graduate-level Applied Mathematics tutor using only 3 person-days of non-expert labor and open-weights 32B models deployable on a single consumer-grade GPU. Our pilot study on a full graduate-level final exam reveals a striking emergence phenomenon: while both zero-shot baselines and standard retrieval stagnate around 50-60% accuracy across model generations, the Shadow Agent, which provides structured reasoning guidance, triggers a massive capability surge in newer 32B models, boosting performance from 74% (Naive RAG) to mastery level (90%). In contrast, older models see only modest gains (~10%). This suggests that such guidance is the key to unlocking the latent power of modern small language models. This work offers a cost-effective, scientifically grounded blueprint for ubiquitous AI education.
Zonglin Yang, J. -H. Xie, Lining Zhang +2
School of Mechanics and Engineering Science, Peking University, Beijing, 100871, China · Readraft Intelligent Technology Co., Ltd., China · Graduate School of Education, Peking University, Beijing, 100871, China +1
Education is one of the most promising real-world applications for Large Language Models (LLMs). However, current LLMs rely on static pre-training knowledge and lack adaptation to individual learners, while existing RAG systems fall short in delivering personalized, guided feedback. To bridge this gap, we present DeepTutor, a fully open-source agentic framework that unifies citation-grounded problem tutoring with difficulty-calibrated question generation. A hybrid personalization engine couples static knowledge grounding with dynamic learner memory, continuously adapting each interaction to the student's evolving needs. The same personalization substrate further extends to adaptive learning workflows, interactive books, and proactive multi-channel tutoring agents. To evaluate personalized tutoring, we introduce TutorBench, an interactive benchmark incorporating customized learner profiles grounded in university-level curricula across five domains. We further propose an LLM-based first-person interactive evaluation protocol that conducts assessments via a profile-driven student simulator. Complementary evaluations on established benchmarks, supported by human-alignment and ablation studies, confirm the framework's robustness and general utility. Results show that DeepTutor improves personalized metrics by 10.8% on average and strengthens general agentic reasoning across five backbone models by 29.4%.
The advent of Generative Artificial Intelligence (GenAI), and in particular Large Language Models (LLMs), is reshaping educational practice, while intensifying ethical debate about its adoption. To date, the dominant paradigm remains cloud-based and text-only chatbot: a centralized service that offers limited pedagogical control, weak transparency over knowledge sources, and non-trivial risks for privacy and regulatory compliance. This model also presumes continuous connectivity and recurring API costs, creating structural barriers for many institutions, reinforcing existing digital divides. At the same time, educational interaction with LLM can benefit from multimodal cues and embodied presence, requiring interfaces that move beyond text-only tutoring. In this work, we propose ELEVATE (Efficient LLM Education with Virtual Avatar Teaching Engine), a framework to develop efficient GenAI-driven avatar tutors governed by epistemic infrastructures. ELEVATE integrates LLM-driven dialogue with embodied 3D avatars for multimodal interaction and adopts a local-first execution model enabling deployment on consumer-grade hardware. The framework formalizes a three-stratum design that separates (i) a student-facing virtual avatar interaction layer, (ii) a local GenAI execution and multimodal synthesis core, and (iii) a teacher-facing governance layer. We implemented and evaluated a working prototype deployed in a real-world educational curriculum. The system runs on standard PCs and smartphones, and we provide system-level performance evidence to show responsive interaction under realistic hardware constraints. Finally, we discuss sociotechnical and pedagogical implications for responsible adoption, positioning ELEVATE as a scalable pathway for privacy-preserving and inclusive GenAI tutoring across heterogeneous school environments.
Lorenzo Stacchio, Michele Giordano, Daniele Berardini +2