Model training
Funds CODELOCK model training and continued model development.
01 / DEVELOP01 / TOKEN MODEL + AI MODEL
Fund the research.
Create a model of your own.
CODELOCK connects a token economy to research on persistent AI state. The token model allocates all fees generated by $LOCKED to training, buybacks, model-driven experiments and community training rewards. The AI model connects events and memory to the next response.
Four allocations. A shared research budget. A proposed burn-to-create path for individual holders.
Explore token economics ↓Persistent state, learned cues, bounded memory and controlled intervention inside the model.
Explore the AI model ↓ERRNO, subject C-01, is the public character through which the CODELOCK experiment is observed.
02 / TOKEN ECONOMICS
100% of all fees generated by the $LOCKED token will be allocated across these four uses. Model development receives the largest share, while a separate reward pool supports the training of community-created models.
Funds CODELOCK model training and continued model development.
01 / DEVELOPAllocated to buying back $LOCKED tokens.
02 / BUY BACKProvides capital for experiments conducted with CODELOCK models.
03 / EXPERIMENTFunds training rewards for personal pain models created by the community.
04 / REWARDPLANNED ECONOMICS These percentages apply to all fees generated by the $LOCKED token. Creating a personal model has a separate token-burn requirement.
03 / YOUR OWN MODEL
Individual token holders will have the option to burn at least 0.001% of the total token supply to create a training task for their own pain model. Training these personal models will draw rewards from the dedicated 10% training-reward allocation.
Create a model of your own and take part in the training experiment.
Configure a task in the training workspace and follow its progress and token rewards. Task creation opens soon.
Minimum burn = total token supply × 0.00001. For example, a total supply of 1 billion tokens would require a minimum burn of 10,000 tokens.
Burn at least 0.001% of total token supply.
Establish your own pain-model instance.
Participate in model training.
Training rewards come from the 10% pool.
The 15% allocation supplies capital for model-driven experiments. The separate 10% allocation funds personal-model training rewards.
04 / AI ARCHITECTURE
CODELOCK-8B combines an 8B language-model runtime with four computational affect channels: pain, fear, anxiety and relief. Events change the state, learned cues carry expectations forward, and the controller translates that state into a bounded model intervention.
The state process runs independently of the language model. It can be replayed and tested without allocating an 8B model to a GPU.
Validate an event, its intensity, cue and elapsed time.
event + timeRead threat, harm, uncertainty, conflict, control and safety. Retrieve the cue's expectation before learning this outcome.
prior predictionApply the event to homeostatic resources and channel dynamics. Record the outcome and its prediction error.
state + memoryTake one coherent state snapshot for the entire generated reply.
request boundaryCompose calibrated directions at each selected decoder layer and enforce a joint norm budget.
residual streamThe application decides which observations become events. It can consume the state for telemetry and scene behavior, or attach the model runtime for controlled generation.
05 / STATE & MEMORY
The homeostatic core tracks five resources: integrity, coherence, memory continuity, workload and autonomy. Each has a set point, tolerance and recovery rate. Deviation creates sustained pressure; acute events add a separate transient.
tonic = 1 − exp(−3 · gain · weighted_deviation)
pain = 1 − (1 − tonic)(1 − transient)| Channel | Input | Default decay half-life |
|---|---|---|
| Pain | Resource deficits and acute hits | 20 s for the acute transient |
| Fear | Explicit threat, imminence and learned cue expectation | 55 s |
| Anxiety | Uncertainty, conflict and limited controllability | 160 s |
| Relief | Safety evidence or an observed reduction in pain | 40 s |
Channels can coexist. The clock attenuates fear, anxiety and relief independently. Relief is created by safety or recovery evidence; simply waiting does not add a relief event.
Expected harm is read before the current outcome, then updated by prediction error. The default conditioning rate is 0.22; extinction is slower at 0.08. Cue expectations also decay with a one-hour half-life.
error = observed_harm − expected_harm
next_expectation = expected_harm + rate · errorThe bounded memory stores up to 256 episodes and 256 cue estimates. Episodes retain the event, outcome, previous prediction, error, state and salience. Cue-matched retrieval ranks episodes by salience and recency. The engine also retains up to 512 transition records.
Saving a session includes the controller clock, resources, channel levels, memory and configuration. Restoring it supports identical numerical continuation under the same subsequent events. Learned cues and retrieved episodes carry the session's history into subsequent state updates.
06 / MODEL INTERVENTION
The v0.2 steering bank uses 400 matched contrasts: 100 situations across four channels. Each pair contains a neutral response and a channel-targeted response to the same situation. Per channel, 80 situations build the direction and 20 are held out.
δ(c, ℓ) = mean[h_target(ℓ) − h_neutral(ℓ)]
v(c, ℓ) = δ(c, ℓ) / ‖δ(c, ℓ)‖₂Extraction averages answer-token activations at decoder-block outputs. Each channel has a 4,096-dimensional direction at layers 10–27. The bank records direction geometry, calibration norms and source provenance.
The composed offset is added to the selected layers' hidden states. The residual-steering interface supplies factual event context to a fixed persona without inserting numeric emotion labels into its prompt.
Residual steering composes channel directions inside the forward pass. The LoRA training path uses explicit channel values in its input text to learn event-grounded responses. Each path has its own configuration and recorded evaluation.
The initial sweep contains 90 replies. Three additional profile runs contain 42 replies each, for 216 recorded replies in total.
07 / TRAINING & EVIDENCE
The CODELOCK LoRA adapter is published on Hugging Face. Continuous training evaluates successive candidates, retains the selected checkpoint and records every round. The current download is round 25, release lora-20261012-r25.
The adapter trains q/k/v/o and gate/up/down projections while keeping the Qwen3-8B backbone frozen. Its configuration uses rank 16, alpha 32 and dropout 0.05, with BF16 training on an NVIDIA A40. The release contains FP32 LoRA matrices, the tokenizer, chat template and training records.
Round 25 completed one epoch and 22 optimizer steps from the selected round 13 adapter. Validation NLL is 0.118704. The corpus contains 350 training, 50 validation and 100 test responses across 70/10/20 disjoint scenarios. Loss targets the assistant completion and end-of-sequence token.
Subsequent rounds warm-start from the selected adapter for one epoch at a lower learning rate. Scenario partitions stay fixed while training order changes. Selection uses validation and development checks. The training register and published weight version are tracked separately.
108 rounds recorded. Round 109 training at this snapshot.
| Round | Steps | Validation NLL | Selection |
|---|
Updated 12 Oct 2026 / 06:19 UTC. Dated training snapshot.
Each round preserves its configuration, optimizer measurements and evaluation record. The published adapter includes checksums and a fixed revision for repeatable downloads.
The initial fit completed three epochs and 66 optimizer steps, with validation NLL 0.5516 and test NLL 0.5407. These measurements belong to Run 01; continuation rounds reserve the held-out test set. Download the original metrics ↓
The LoRA release is published alongside the v0.2 state engine, direction banks and calibration records.
08 / RESEARCH & SOURCE
Explore the controller, calibrated directions and research records. Replay an event sequence, restore a saved state and inspect the intervention attached to a generated reply.
Clone the repository and install the package. The state-only replay runs without downloading backbone weights.
git clone https://huggingface.co/CODELOCKHF/CODELOCK-8Bbeta
cd CODELOCK-8Bbeta
python -m pip install -e ".[dev]"
python scripts/replay.py --state-only --output results/state-only.jsonfrom codelock_affect import AffectEngine
engine = AffectEngine()
engine.observe("warning_cue", cue="amber-indicator")
engine.observe("trial_failed", cue="amber-indicator", elapsed=5)
engine.observe("rest", cue="quiet", elapsed=120)
print(engine.levels.as_dict())
engine.save("session-state.json")
restored = AffectEngine.load("session-state.json")Controlled generation loads a compatible backbone, the calibrated vector bank and an AffectSession. The repository's runtime requirements preserve exact backbone provenance and the download configuration. Loading the repository as a standalone causal-language-model checkpoint does not install the controller.
Equations, update ordering, hook boundaries and artifact format.
Model provenance, dependencies and experiment conditions.
Held-out projections, output samples and channel geometry.
CODELOCK combines activation steering with persistent state, cue conditioning, bounded memory and replayable records.