[{"data":1,"prerenderedAt":257},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fdesign":3},{"id":4,"title":5,"body":6,"description":16,"extension":250,"meta":251,"navigation":252,"path":253,"seo":254,"stem":255,"__hash__":256},"content\u002Fdocs\u002Fdesign.md","Model architecture",{"type":7,"value":8,"toc":243},"minimark",[9,13,17,20,25,33,51,54,58,83,177,180,194,198,204,211,236,239],[10,11,5],"h1",{"id":12},"model-architecture",[14,15,16],"p",{},"Linnaeus accepts a state and independent questions and returns temperature-scaled\nprobabilities over supplied candidates. The training and serving templates are\nshared. A request reuses its causal prefix and computes question suffixes in\nparallel. Frozen image features are encoded on a cache miss and shared. More\nquestions still require more suffix compute.",[14,18,19],{},"Each sequence contains the state, question, candidate descriptions, and a\nreserved marker after each candidate. A shared scalar head scores the marker's\nhidden state. A per-question softmax gives the decision distribution. Nominal\ncandidate order is shuffled during training; binary and ordinal order are fixed.\nCandidate-order sensitivity is measured on held-out data.",[21,22,24],"h2",{"id":23},"fixed-recipe","Fixed recipe",[14,26,27,28,32],{},"The Qwen3.5 adapter freezes the base and vision encoder and trains rank-8\nlanguage LoRA plus the scorer. The training recipe fixes precision, image and\nsequence budgets, optimizer, learning rates, sampling, checkpoint\nselection, and calibration. ",[29,30,31],"code",{},"recipe.py"," is the executable specification.\nRun metadata records all values and data hashes, including values that callers\ncannot change.",[14,34,35,38,39,42,43,46,47,50],{},[29,36,37],{},"RLCDConfig(sigma=0.3, ce_weight=1.0)"," is the complete RLCD configuration surface.\n",[29,40,41],{},"sigma"," controls exploration in logit space; ",[29,44,45],{},"ce_weight"," controls the joint\ncross-entropy term. Four samples, the proper-scoring reward, ordinal distance\npenalty, baseline estimator, and numerical safeguards are fixed. ",[29,48,49],{},"--steps","\ncontrols the total update budget.",[14,52,53],{},"The release path merges LoRA before calibration and final evaluation. Loading\nthe compact checkpoint reconstructs that same merged model from the pinned\nbase. The caller does not choose merge state, precision, attention backend,\nLoRA rank, or calibration mode.",[21,55,57],{"id":56},"model-adapters","Model adapters",[14,59,60,63,64,67,68,67,71,74,75,78,79,82],{},[29,61,62],{},"Qwen35Adapter"," contains the backbone-specific code. Another backbone supplies\nan adapter object to ",[29,65,66],{},"DecisionModel",", ",[29,69,70],{},"DecisionCollator",[29,72,73],{},"train",", and\n",[29,76,77],{},"final_evaluation","; ",[29,80,81],{},"Predictor.from_checkpoint(..., adapter=adapter)"," validates\nits identity against the saved artifact.",[84,85,86,99],"table",{},[87,88,89],"thead",{},[90,91,92,96],"tr",{},[93,94,95],"th",{},"Adapter responsibility",[93,97,98],{},"Contract",[100,101,102,122,138,154,167],"tbody",{},[90,103,104,119],{},[105,106,107,67,110,67,113,67,116],"td",{},[29,108,109],{},"name",[29,111,112],{},"base_model",[29,114,115],{},"marker",[29,117,118],{},"image_prefix",[105,120,121],{},"Stable identity, one reserved candidate token, image prompt syntax",[90,123,124,135],{},[105,125,126,67,129,67,132],{},[29,127,128],{},"processor",[29,130,131],{},"load",[29,133,134],{},"hidden_size",[105,136,137],{},"Load the pinned processor\u002Fbackbone and size the shared scorer",[90,139,140,151],{},[105,141,142,67,145,67,148],{},[29,143,144],{},"adapt_language",[29,146,147],{},"merge",[29,149,150],{},"freeze_vision",[105,152,153],{},"Apply the training and deployment lifecycle",[90,155,156,164],{},[105,157,158,67,161],{},[29,159,160],{},"batch_inputs",[29,162,163],{},"shared_image_inputs",[105,165,166],{},"Preserve all candidates and process shared images once",[90,168,169,174],{},[105,170,171],{},[29,172,173],{},"forward",[105,175,176],{},"Return candidate-addressable hidden states and the shared-prefix position offset",[14,178,179],{},"There is one supplied adapter. Supporting a different backbone requires its\nimplementation and the same checkpoint\u002Fquality acceptance; an arbitrary model\npath alone does not establish compatibility. Model-specific tokenization and\nkernels belong here, without branching the RLCD objective or public decision API.",[14,181,182,183,188,189,193],{},"The ",[184,185,187],"a",{"href":186},"inference","inference reference"," describes question types, response fields,\nand input limits. ",[184,190,192],{"href":191},"bub-agent","Bub integration"," exposes the same decision API to agents.",[21,195,197],{"id":196},"behavior-and-regression-tests","Behavior and regression tests",[14,199,200,203],{},[29,201,202],{},"tests\u002Facceptance.py"," loads the exported checkpoint and exercises the real\nprediction and Bub interfaces. It checks text and image decisions, candidate\nprobabilities, independent requests, reload, and input limits. The training\nworkflow runs this acceptance on its exported weights.",[14,205,206,207,210],{},"The CPU tests in ",[29,208,209],{},"tests\u002Ftest_*.py"," cover reported metric meanings, temperature\ncalibration, the pinned RLCD objective and gradients, and the regression where\nidentical screenshots crossed splits under different source IDs. Run them when\nchanging the corresponding behavior:",[212,213,218],"pre",{"className":214,"code":215,"language":216,"meta":217,"style":217},"language-bash shiki shiki-themes github-light github-dark","mise run test\n","bash","",[29,219,220],{"__ignoreMap":217},[221,222,225,229,233],"span",{"class":223,"line":224},"line",1,[221,226,228],{"class":227},"sScJk","mise",[221,230,232],{"class":231},"sZZnC"," run",[221,234,235],{"class":231}," test\n",[14,237,238],{},"Tests assert observable behavior or a known failure case. Internal allocation,\nhelper structure, log keys, file counts and exact error wording are not contracts.\nQuality evaluation separately measures held-out accuracy, calibration,\ncandidate-order sensitivity and image dependence.",[240,241,242],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":217,"searchDepth":244,"depth":245,"links":246},2,3,[247,248,249],{"id":23,"depth":244,"text":24},{"id":56,"depth":244,"text":57},{"id":196,"depth":244,"text":197},"md",{},true,"\u002Fdocs\u002Fdesign",{"title":5,"description":16},"docs\u002Fdesign","pocNQdGiempJ_tKpOc3mk8BrI3_EE8KSu3d-QtC_8AE",1790560641966]