Getting Started#
Installation#
pip install ice-icl
# or from source:
pip install -e "/path/to/ICEICL[train]"
Quick Example#
import numpy as np
from iceicl import ICEICLModel
# Load a trained checkpoint (or use random weights for testing)
model = ICEICLModel(arm="ssm_cross", max_classes=10)
X_train = np.random.randn(100, 8).astype(np.float32)
y_train = np.random.randint(0, 3, size=100)
X_test = np.random.randn(20, 8).astype(np.float32)
# One forward pass — no fitting
probs = model.predict_proba(X_train, y_train, X_test)
labels = model.predict(X_train, y_train, X_test)
Core Concepts#
- In-context learning
The model receives labeled training rows and unlabeled test rows in a single forward pass. No gradient updates, no fine-tuning — the model’s weights are frozen and only the input context changes.
- Context size
More training rows sharpen the channel estimate but increase inference cost. ICE-ICL scales linearly in context size (O(n) SSM scan).
- Adaptive bandwidth
Per-head attention temperatures are derived automatically from the estimated data geometry — no manual tuning required.