●●●CrowdCode™›User guideversion 1.0.1We the People AI
Enclawed CrowdCode™ user guide · Fine-tuning and what's coming · version 1.0.1

Fine-tuning and what's coming

Your sessions, your model

CrowdCode™ can make its model better at your work by learning from your own sessions. You are the teacher. When the model gets something wrong, you undo it and show it what you wanted. CrowdCode™ remembers both, and learns from the difference.

Each round of learning is a small add-on to the model, called a LoRA adapter: the change to the model's weights, kept apart from the model as a patch. The model itself never changes, so removing the adapter gives you the original model back exactly.

Choosing what the model learns from

Every task you finish is kept as a candidate. Nothing is learned until you approve it.

ccode training

In a terminal this opens a picker. Each session has a number, its field, a one-line summary of what was done, and how it ended. Type numbers to tick or untick them (3, 1-4 7), c physics to tick a whole field (u physics to untick it), a for all, s 3 to look at one, then press Enter to save. Ctrl+C leaves everything as it was.

The same without the picker:

ccode training list              # the numbered list
ccode training show 3            # one session in detail
ccode training approve 1-4 7     # by number, range, run id, or: all
ccode training revoke 2          # take it back
ccode training forget 5          # delete it for good

Fields and topics

After each task, the model writes the summary and picks the session's topic from a fixed list. That list covers every use of the model, not only coding: software, testing, operations, data, AI, security, mathematics, physics, chemistry, life sciences, Earth sciences, engineering, business, writing, education and the arts. Each field has its own topics, such as physics.quantum or math.probability.

ccode training topics            # the whole list
ccode training label             # label sessions that have no label yet

Topics let you:

  • choose by field in the picker;
  • train one field with ccode train --category physics;
  • keep earlier fields from being forgotten, since replay takes lessons from every field alike.

Every adapter records the topics it learned (ccode adapters).

Approve only sessions whose code is yours and that hold no output generated by Claude. A session that held a password or key was never kept in the first place.

How to teach it a correction

  1. Ask for something. The model does it, but not the way you want.
  2. Type /undo. The files go back as they were.
  3. Say what you wanted ("no, use a Map instead"). The model does it again, and you keep it.

The first try and the kept one, for the same request, make a correction. The list shows it as "undone → corrected by #4". A task that is rolled back because its checks failed counts too.

Training: ccode train

Training runs when you choose: overnight while you sleep, during the day when you're not coding, or on another computer.

ccode train --dry-run            # what it would learn, and how long it would take
ccode train                      # learn now
ccode train --until 07:00        # stop in time to be done by 7 in the morning
ccode train --hours 3            # at most three hours
ccode train --on gpu-box         # train on another computer (a server set up with ccode setup)
ccode train --category physics   # learn only this field's new sessions (a topic works too)

While it trains:

  • CrowdCode™ pauses its own models, because training needs the GPU. It never stops anyone else's programs. If the GPU is busy, it says so and stops.
  • It shows its progress and how long is left, measured on your GPU. After the first run, --dry-run knows your GPU's speed and estimates before anything starts.
  • Ctrl+C stops it. Nothing changes: the model stays as it was.
  • CrowdCode™ sessions wait until it's done, and tell you when that will be.

Corrections are learned as preferences (the kept answer over the undone one), and kept sessions as examples.

Why it doesn't forget

An adapter has limited room, so learning new things can push out old ones. CrowdCode™ guards against that in four ways:

  • Replay. Each round also re-learns a sample of earlier lessons.
  • Separate directions. Each round changes the model in directions earlier rounds didn't use.
  • The check. Before a new round is used, vLLM scores it on your earlier lessons and on general coding questions, and the round has to solve at least as many coding tasks (ccode bench) as the current model. If the round forgot earlier lessons, drifted on general coding, or learned nothing new, it isn't kept and the model stays as it was. ccode train shows the scores.
  • Compaction. When the adapter fills up, CrowdCode™ folds it into fewer directions, keeping what matters most, and checks the result the same way. This happens on its own, or with ccode adapters compact.
ccode adapters meter             # how full the adapter is
ccode adapters                   # the rounds, and the fields each learned

Does it actually code better? ccode bench

ccode bench                      # realistic coding tasks of every kind (suite v2)
ccode bench --suite v1           # the 12 small single-file tasks
ccode bench list                 # the tasks, with their kind
ccode bench history              # every result so far, per model and round
ccode bench --model crowdcode-lora-r0003   # a particular fine-tuning round

Each task is a real CrowdCode™ task in a throwaway project: fix a bug, implement a function, rename across files, and so on. The model works on it alone, with Enclawed™ deciding every action. When it finishes, hidden tests that it never saw decide whether it passed, so it can't pass by editing the tests.

The v2 tasks are small real projects of several files, of every kind of coding work: fixing bugs, adding features, refactoring, writing tests, debugging from an error message, build and configuration fixes, scripts, and answering questions about the code. The result is given per kind, and as one score weighted by how coding work is split. At first that split is an estimate. Once 10 or more of your sessions are labeled (ccode training label), it is your own: the benchmark then counts most what you actually do.

  • ✓ means passed and ✗ failed.
  • ⊘ means Enclawed™ wouldn't run the check, because it couldn't confine the code the model wrote. That counts as not passed.

Run it before and after a training round to see whether the round helped with real work, not just with your examples. ccode train does this for you: a new round is kept only if it solves nearly as many tasks as the current model (within the benchmark's run-to-run noise). That adds about twenty minutes; --no-bench skips it, but isn't recommended. In testing, a round that learned its lessons well and passed vLLM's check still solved only 4 tasks where the model before it solved 8. This check is what caught it.

Taking your training with you

ccode patch export my-model.ccpatch      # the newest round, and the lessons it learned
ccode patch apply my-model.ccpatch       # on another computer

The patch file records the base model and the topics the adapter learned, so adapters can be grouped by model and by topic without opening them.

On the same base model, for example a fresh download of the same model, the patch plugs straight in. CrowdCode™ checks this by the base weights' digest (ccode models --digest records it once).

On a different base model, for example a newer one, an adapter can't carry over. Instead, the patch's lessons are kept, and the next ccode train learns them on the new model. Add --no-lessons to export the adapter alone: lessons hold your sessions' text, so share them only with people you'd share that code with.

Experimental: not in the first release

These are designed but are placeholders for now:

  • Crowd verification: other people re-run a task's checks and confirm the result.
  • CrowdCoin mining: sharing your fine-tuning rounds, if you choose to.