Jayce:基于原型记忆的本地LLM即时纠错框架,速度超反向传播4倍
I built a framework-free prototype learner that lets local LLMs learn and correct facts instantly (1.6x–4x faster than backprop)[R]
提供了一套可复现的、绕过传统微调的本地模型即时纠错工程方案,性能指标明确且代码轻量,适合关注端侧部署与高效学习的开发者直接落地验证。
Hey everyone,
大家好,
I wanted to share a project I’ve been working on called Jayce.
我想分享一个我一直在做的项目,名叫 Jayce。
The whole thing started because I was watching a toddler named learn the names of stuff He didn't need to completely rewire his brain or look at ten thousand examples to figure a word out—he just needed a few specific examples and quick corrections from his parents.
这一切的起因是我观察到一个叫 learn 的幼儿学习物品名称的过程。他不需要完全重塑大脑,也不需要看一万次例子就能搞懂一个词——他只需要父母提供几个具体的例子和快速的纠正。
It got me thinking about local LLMs. Right now, dealing with catastrophic forgetting is a massive pain. If you want a local model to remember a new fact, you're usually stuck spinning up a heavy RAG pipeline or risking its existing weights with slow, tedious fine-tuning.
这让我开始思考本地大语言模型(LLM)。目前,应对灾难性遗忘是一个巨大的痛点。如果你想让本地模型记住一个新事实,你通常只能被迫搭建沉重的 RAG 管道,或者冒着风险使用缓慢且繁琐的微调来修改其现有权重。
So after watching him, I stumbled into building a lightweight experiment using Adaptive Prototype Memory (APM) to see if a model could learn the same way.
所以,在观察完那个孩子后,我着手构建了一个轻量级实验,利用自适应原型记忆(APM)来测试模型是否能以同样的方式学习。
Instead of messing with model weights, it grabs the LLM's raw context vectors and drops them into a fixed pool of 4,096 prototype slots. If the model gets something wrong and you correct it, it physically shifts the closest mathematical prototype toward the new data right then and there.
它不触碰模型权重,而是提取 LLM 的原始上下文向量,并将它们放入一个包含 4,096 个原型槽位的固定池中。如果模型答错了而你进行了纠正,它会立即将最接近的数学原型向新数据物理偏移。
Honestly, I just built it as a neat proof of concept, but when I actually ran the benchmarks, I was pretty surprised by how well it held up against backpropagation:
老实说,我只是把它作为一个有趣的概念验证来构建的,但当我实际运行基准测试时,它对标的表现让我相当惊讶:
- It’s fast: The training updates run about 1.6 to 4 times faster than a standard neural network using Adam backprop.
- It’s incredibly sample-efficient: On sequential tests like MNIST digits, it actually pulled off higher accuracy than backprop when given the exact same number of training examples.
- It's lightweight: It keeps everything locked under a strict memory ceiling so it doesn't hog your system.
- 它很快:训练更新的速度比使用 Adam 反向传播的标准神经网络快约 1.6 到 4 倍。
- 它在样本效率上极高:在 MNIST 数字等顺序测试中,当给予相同数量的训练样本时,它的准确率实际上超过了反向传播。
- 它很轻量:它将一切严格限制在内存上限内,不会占用你的系统资源。
I wanted the math to be as readable as possible, so I wrote the whole thing framework-free. No PyTorch or TensorFlow—just pure NumPy (jayce_tokens.py) and native Java (JayceMemory.java). It runs completely offline on consumer hardware with a local Qwen3-4B GGUF.
我希望代码尽可能易读,所以我用无框架的方式编写了整个项目。没有 PyTorch 或 TensorFlow——只有纯 NumPy(jayce_tokens.py)和本地 Java(JayceMemory.java)。它在消费级硬件上完全离线运行,使用的是本地 Qwen3-4B GGUF 模型。
The repo has the full benchmark data, a breakdown of how the vector shifting works, and a terminal script where you can test the learning loop yourself:
仓库包含了完整的基准测试数据、向量偏移工作原理的分解说明,以及一个终端脚本,你可以在其中亲自测试学习循环:
https://github.com/Loophole-LLC/Jayce
https://github.com/Loophole-LLC/Jayce
I'd love to get some feedback on it. Let me know what you think!
我很想听听大家的反馈。请告诉我你们的想法!
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力