{% from "_macros.html" import chart %} {# Vocabulary projection for _experiment.html. Expects `v` and `sub`. #} {% from "_macros.html" import fold, read_more %} {% if sub.vocabulary_lens %} {% set vl = sub.vocabulary_lens %}{% set vc = v.vocab %} {% call fold("Vocabulary projection") %}

The tokens that this unit's output raises and lowers most.

{% if vc %}
{% for panel in vc.panels %}

{{ panel.title }}

{% set _label %}{{ panel.title }}: z-scores of the {{ panel.rows | selectattr('promoted') | list | length }} most promoted and {{ panel.rows | rejectattr('promoted') | list | length }} most suppressed tokens. Values are in the table below.{% endset %}{% call chart(vc.width, vc.height, "Vocabulary projection", _label | trim, role="img") %} {% for tx, label in vc.ticks %} {% endfor %} {% for r in panel.rows %} {{ r.label }} {{ r.text }} {% endfor %} {% for tx, label in vc.ticks %} {{ label }} {% endfor %} {% endcall %}
{% endfor %}
promotes suppresses Hover a bar for its value.
Values
{% for panel in vc.panels %}{% endfor %} {% for row in vc.table %} {% for panel in vc.panels %}{% for side in ("promoted", "suppressed") %}{% set cell = row[panel.key ~ "_" ~ side] %} {% endfor %}{% endfor %} {% endfor %}
#{{ panel.title }} promotessuppresses
{{ row.rank }}{% if cell %}{{ cell[0] }}{% endif %} {% if cell %}{{ "%+.2f" | format(cell[1]) }}{% endif %}
{% else %} {% for label, jac, logit in [("Promotes", vl.jacobian_promoted, vl.logit_promoted), ("Suppresses", vl.jacobian_suppressed, vl.logit_suppressed)] %} {% endfor %}
Jacobian lens Logit lens
{{ label }} {% for t in jac[:8] %}{{ t }}{% endfor %} {% for t in logit[:8] %}{{ t }}{% endfor %}

This record predates vocabulary z-scores, so the tokens are listed without bars.

{% endif %}

Top-10 overlap {{ vl.overlap | pct }} · cos(w, J·w) {{ vl.direction_cosine | num(2) }} · kurtosis {{ vl.jacobian_kurtosis | num(1) }} (Jacobian) / {{ vl.logit_kurtosis | num(1) }} (logit) · {{ vl.prompts }} prompts

{% call read_more() %}

The output direction is read through the final norm and the unembedding. The Jacobian lens first carries it to the last layer. Bar length is the token's z-score over the vocabulary, and ␣ marks a space. A kurtosis near 3 means no specific set of tokens.

{% endcall %}
{% endcall %} {% endif %}