Instructions to use yakupkahraman/gemma2-2b-aep with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLC-LLM
How to use yakupkahraman/gemma2-2b-aep with MLC-LLM:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Gemma-2-2B-AEP
A custom-compiled Gemma-2-2B that exposes its internal residual-stream activation during generation, together with a trained AEP probe that reads an emotional state (valence / arousal) from that activation.
This is a reference artifact for AEP โ AI Emotion Protocol: a working example showing that a model's internal emotional state can be read directly from its activations, not inferred from its text.
What this is
Standard model runtimes return only logits. This build adds an extra entry point that also returns the layer-22 residual-stream activation (hidden size 2304) at each step. A lightweight probe projects that activation onto learned valence and arousal axes, producing a structured emotion reading per span of tokens.
The result: while the model generates text, you get a live stream of its internal affective state โ which can diverge from what the text says.
Contents
| File | What it is |
|---|---|
gemma2-2b-aep-q4f16_1-cuda.so |
The compiled model library (MLC LLM, CUDA / sm_86, q4f16_1 quantization) with the AEP activation entry point. |
gemma2-2b-aep-q4f16_1/ |
Quantized weights, tokenizer, and MLC chat config for the compiled model. |
aep_vectors_gen.npz |
The trained AEP probe: valence axis, arousal axis, emotion reference vectors, and gates. Trained on generation-regime activations. |
Base model & license
Built on google/gemma-2-2b-it and distributed under the Gemma license. You must agree to the Gemma terms to use these weights.
How it works (brief)
- Layer 22 of the 26-layer network is tapped โ deep enough to hold abstract state, before the final projection to vocabulary.
- The probe was trained on activations captured during generation, not while encoding a prompt. This distinction matters: a probe trained in the prompt regime degrades sharply when applied during generation. Training in-regime raised valence separation (d-prime) from ~1.4 to ~4.1.
- The probe is read-only: it observes the activation and never alters the model or steers generation. The reading reflects the model's actual internal state, not a self-report.
Usage
This is an MLC LLM compiled artifact, not a standard Transformers checkpoint. It requires an MLC LLM runtime with the AEP entry point. See the AEP repository for the model service that loads and serves it.
The CUDA library is compiled for sm_86 (e.g. RTX 30-series). Other GPUs require recompilation.
Emotion reference set
The probe reports valence [-1, +1] and arousal [0, 1], plus a dominant label from: delighted, cheerful, content, calm, anxious, angry, desperate, sad (and neutral when the signal is weak).
Citation
Part of the AEP (AI Emotion Protocol) project by Yakup Kahraman. See https://github.com/yakupkahraman/aep for the specification.
- Downloads last month
- -