EISV-Lumen Student -- Distilled RandomForest for Edge Deployment
A lightweight RandomForest ensemble distilled from the EISV-Lumen Teacher (LoRA on Qwen3-4B). On 1,080 held-out teacher-labelled windows it scores 0.998 expression coherence, a near-saturated token-to-shape fit score (the rule-based baseline scores 0.500), while matching the teacher's exact pattern 47% and first token 37% of the time; see Results. It fits in ~13 MB of JSON with zero external dependencies -- only Python stdlib required. Designed to run on a Raspberry Pi 4 (Lumen's physical host).
Model Details
| Field | Value |
|---|---|
| Method | Knowledge distillation (teacher-labeled soft targets) |
| Architecture | 3 independent RandomForest classifiers (sklearn) |
| Input features | 12 numeric (EISV means, deltas, accelerations) + 9 shape one-hot |
| Training data | 4,320 teacher-labeled examples (467β499 per shape after the pattern-stratified split) |
| Test data | 1,080 held-out examples (same stratified split as training) |
| Format | Zero-dependency JSON (~13 MB) |
| Target hardware | Raspberry Pi 4 (1.5 GHz ARM, 4 GB RAM) |
How It Works
The student decomposes EISV expression generation into three chained classification problems, each solved by an independent RandomForest:
- Pattern classifier -- predicts one of 5 expression patterns:
SINGLE,PAIR,REPETITION,QUESTION,TRIPLE - Token-1 classifier -- predicts the primary EISV token from 15
classes (e.g.,
~stillness~,~warmth~,~emergence~) - Token-2 classifier -- predicts the secondary token from 15 + none, conditioned on the Token-1 prediction (token1 index appended as extra feature)
The pattern determines how tokens are assembled into the final expression
string (e.g., PAIR yields two distinct tokens, REPETITION repeats
token-1 twice).
Results
All figures are on the 1,080 held-out windows. Agreement means matching the teacher's label for the same window.
| Metric | Student (RF) | Rule-based baseline |
|---|---|---|
| Coherence | 0.998 | 0.500 |
| Token-1 agreement | 0.369 | -- |
| Pattern agreement | 0.467 | -- |
| Full agreement (all 3 match) | 0.090 | -- |
The baseline is the shape-conditioned, affinity-weighted rule generator, sampled 10 times per window. It is not a uniform-random baseline.
Reading these numbers. Coherence rewards any token in the shape's high-affinity region, so it is close to saturated. The student reaches it while matching the teacher's exact choices only about a third to half of the time: it reproduces the shape-to-token affinity structure, not the teacher's specific choices. The teacher's 0.952 comes from 500 real Lumen windows, a different test set, so the two coherence figures are not comparable.
Correction (2026-11-29). Earlier versions of this card reported coherence 0.986 and agreement 0.688 / 0.652 / 0.403. The evaluation script re-split the data without the stratification used in training, so 871 of its 1,080 "held-out" rows were training rows. The figures above use the true held-out split and match
training_metrics.json(pattern 0.467, token-1 0.369). Fixed in cirwel/eisv-lumen#10.
Zero-Dependency Usage (recommended for edge)
The exported/ directory contains JSON-serialized forests and a standalone
inference module. No pip packages required.
from student_inference import StudentInference
student = StudentInference("path/to/exported/")
result = student.predict("settled_presence", {
"mean_E": 0.7, "mean_I": 0.6, "mean_S": 0.2, "mean_V": 0.05,
"dE": 0.0, "dI": 0.0, "dS": 0.0, "dV": 0.0,
"d2E": 0.0, "d2I": 0.0, "d2S": 0.0, "d2V": 0.0,
})
# result = {"pattern": "REPETITION", "token_1": "~holding~",
# "token_2": "~holding~", "eisv_tokens": ["~holding~", "~holding~"]}
Only json and os from the standard library are used. The inference
module walks each decision tree node-by-node and averages class
probabilities across all trees -- identical to sklearn's predict logic.
File Structure
eisv-lumen-student/
|-- README.md # This file
|-- training_metrics.json # Cross-validation metrics
|-- eval_results.json # Full evaluation results
|-- exported/ # Zero-dependency JSON format
|-- pattern_forest.json # Decision trees as JSON (3.0 MB)
|-- token1_forest.json # Decision trees as JSON (4.5 MB)
|-- token2_forest.json # Decision trees as JSON (5.1 MB)
|-- scaler.json # Scaler parameters (511 B)
|-- mappings.json # Label mappings (1.1 KB)
|-- student_inference.py # Standalone inference (4.9 KB)
Training Details
- Distillation source: Teacher (Qwen3-4B LoRA v6, 0.952 coherence on real Lumen trajectories)
- Data generation: 5,400 EISV windows labeled by teacher inference (600 per shape x 9 shapes; windows from the Hub dataset, which itself mixes real and synthetic windows, plus locally generated synthetic backfill for rare shapes; per-row provenance not recorded), split 4,320 train / 1,080 held-out, stratified by pattern. The feature scaler was fitted on all 5,400 rows, so the held-out rows are unseen by the forests but not by the scaler.
- Forest hyperparameters:
n_estimators=50,max_depth=12,class_weight="balanced",random_state=42(read from the saved pickles) - Feature engineering: 12 numeric features (4 EISV means + 4 first
derivatives + 4 second derivatives) standardized via
StandardScaler, plus 9-dimensional one-hot encoding of trajectory shape
Related
- Teacher model: hikewa/eisv-lumen-teacher -- Qwen3-4B LoRA that generated the training labels
- Dataset: hikewa/unitares-eisv-trajectories -- EISV trajectory data from Lumen
- Explorer Space: hikewa/eisv-lumen-explorer -- interactive demo
Citation
@misc{eisv-lumen-student-2026,
title = {EISV-Lumen Student: Distilled RandomForest for Edge Deployment},
author = {Wang, Kenny},
year = {2026},
url = {https://huggingface.co/hikewa/eisv-lumen-student},
note = {Knowledge-distilled RandomForest ensemble for EISV expression
generation on Raspberry Pi}
}
- Downloads last month
- 41