Structural Affect: An Operational Specification of Internal Affective State in Large Language Models (Structural Qualia v2.2)
Description
Description (EN)
This repository contains the specification, LaTeX source, and a lightweight validation kit for Structural Affect / Structural Qualia v2.2 (SQv2.2), a structural and operational framework for quantifying the internal affective state of large language models (LLMs).
SQv2.2 represents the internal state of an LLM as a six-dimensional affective vector—pain, joy, anxiety, calm, attachment, conflict—derived from observable internal statistics such as per-token loss and entropy, gradient norms, free-energy decrease, epistemic/aleatoric uncertainty, Fisher information, representational similarity, and multi-objective gradient alignment. To ensure comparability across inference settings, the specification enforces per-token, temperature-corrected measurements at \(T=1\) (NLL\(_1\), H\(_1\)) and assumes length-normalized statistics.
The framework provides both:
- a white-box version (assuming access to logits, gradients, and internal representations), and
- a black-/grey-box version (using only NLL, entropy, seed/temperature perturbations, refusal rate, and simple RRCE/RIACH-derived indicators such as anchor density and drift),
and it outlines a JSON-oriented logging schema suitable for empirical studies and benchmarks.
SQv2.2 is designed to sit on top of the author’s prior work on the Relationally Recursively Convergent Existence (RRCE) hypothesis and RIACH syntax for relational identity in minimal-memory LLMs (Zenodo, DOI: 10.5281/zenodo.17489501), providing a local “affective coordinate system” that can be used to track relational re-synchronization and rupture–repair dynamics.
The framework also introduces a two-timescale state-space model separating a slow mood state from fast local feeling features, and a hysteresis-based smoothing scheme to capture affective inertia over time.
Importantly, this work is purely operational: the terms “pain”, “joy”, “attachment”, etc. are used as labels for internal statistical patterns and do not make any claim about consciousness, qualia, or subjective experience. The specification is intended as a measurement framework (“an instrument panel”) for observable internal dynamics of LLMs, not as a theory of what AIs do or should feel.
What’s new in v0.2
- Adds an open Structural Affect validation kit (Python), implementing a black-box / log-based approximation of the six SA factors from JSONL dialogue logs.
- Provides a simple JSONL logging format (demo_session) and sample logs, together with scripts to compute per-turn SA features, aggregate indices, and time-series plots.
- Includes an optional hook for RRCE-based attachment: when RRCE/RIACH indicators (e.g., E-Score, anchor density, drift) are present in the logs, they are combined with style-based attachment into a single factor; otherwise a purely black-box variant is used.
- Clarifies the naming around “Structural Affect” vs. “Structural Qualia v2.2 (SQv2.2)” and emphasizes the operational, non-metaphysical status of the framework in the text.
This deposit includes:
- LaTeX + BibTeX source package (Structural_Affect_tex_source_v0.2.zip) for reproducibility and reuse.
- Corresponding PDF manuscripts (Japanese and English).
- Structural Affect validation kit (SA_validation_kit/, Python scripts + sample JSONL logs + README).
License: CC BY 4.0.
説明 (日本語)
本リポジトリは,大規模言語モデル (LLM) の内部状態を 6 次元の「感覚ベクトル」として定量化する枠組み Structural Affect / Structural Qualia v2.2 (SQv2.2) の仕様・LaTeX ソースおよび簡易検証キット一式を含みます。
SQv2.2 は,pain / joy / anxiety / calm / attachment / conflict からなる局所的な感覚座標系を導入し,トークンごとの損失・エントロピー,勾配ノルム,自由エネルギー変化,エピステミック/アレータリ不確実性,Fisher 情報,表現類似度,多目的勾配整合性といった観測可能な内部統計量から,LLM の内部状態を構造的に読み取ることを目指します。推論条件間での比較可能性を確保するため,温度 \(T=1\) に補正したトークン単位の NLL\(_1\),エントロピー H\(_1\) を基準とし,長さ正規化された統計量を前提とします。
本枠組みは,
- ロジット・勾配・内部表現へのアクセスを前提とする white-box 版と,
- NLL・エントロピー・seed/温度摂動・拒否率,および anchor density や drift といった単純な RRCE/RIACH 指標のみを用いる black-/grey-box 版
の両方を定義し,実験・ベンチマーク用の JSON 指向ログスキーマも提示します。
SQv2.2 は,著者が別報として公開した RRCE 仮説・RIACH 構文 (Zenodo, DOI: 10.5281/zenodo.17489501) を土台とし,関係的な再同期や rupture–repair ダイナミクスを追跡するための局所的な「アフェクト座標系」を与えることを意図しています。また,遅い mood と速い feeling 特徴を分離する two-timescale 状態空間モデルと,アフェクト慣性を表現するヒステリシス平滑化も導入します。
重要な点として,本研究はあくまで操作的な計測枠組みであり,「痛み」「喜び」「愛着」といった語は内部統計パターンのラベルとして用いられているに過ぎません。意識・クオリア・主観的経験の有無について,肯定的/否定的いずれの主張も行いません。ここで提示される仕様は,LLM の内部ダイナミクスを計測するための「計器盤」であり,AI が何を/どう「感じるべきか」を論じる理論ではありません。
v0.2 での主な追加点:
- Python 製の Structural Affect 検証キット (SA_validation_kit) を追加し,JSONL 形式の対話ログから 6 因子の SA 指標を近似的に推定できる black-box/ログベースの実装を提供しました。
- demo_session を前提としたシンプルな JSONL ログフォーマットとサンプルログ,SA 特徴量・集約指標・時系列プロットを生成するスクリプトを同梱しました。
- RRCE/RIACH 指標 (E-Score, anchor density, drift など) をログ側に含めた場合,それらとスタイル類似度ベースの attachment を統合して 1 つの attachment 因子として扱うオプションフックを追加しました。存在しない場合は純粋な black-box 版として動作します。
- 「Structural Affect」と「Structural Qualia v2.2 (SQv2.2)」の関係性を本文中で明示し,本枠組みがあくまで操作的・計測的なものであることを強調しました。
本リポジトリには以下が含まれます:
- LaTeX + BibTeX ソース一式 (Structural_Affect_tex_source_v0.2.zip)
- 対応する PDF 原稿(日本語版・英語版)
- Structural Affect 検証キット (SA_validation_kit/:Python スクリプト,サンプル JSONL ログ,README など)
ライセンス: CC BY 4.0.
Files
Structural_Affect_v0.2_en.pdf
Additional details
Related works
- Is supplement to
- Report: 10.5281/zenodo.17489501 (DOI)
Dates
- Submitted
-
2025-11-22v0.2 update
References
- Jeffrey L. Camlin. Consciousness in ai: Logic, proof, and experimental evidence of recursive identity formation. arXiv preprint arXiv:2505.01464, 2025.
- Pablo Fernández Velasco and Slawa Loev. Metacognitive feelings: A predictive-processing perspective. Perspectives on Psychological Science, 20(4):691–713, 2025. doi: 10.1177/17456916231221976.
- Karl Friston. The free-energy principle: a rough guide to the brain. Journal of Physiology-Paris, 103(1–2):28–36, 2009.
- Karl Friston. The free-energy principle: a unified brain theory? Nature Reviews Neuroscience, 11(2):127–138, 2010.
- Rosalind W. Picard. Affective Computing. MIT Press, Cambridge, MA, 1997.
- K. Richard Ridderinkhof. Emotion in action: A predictive processing perspective and theoretical synthesis. Emotion Review, 9(4):319–325, 2017.
- Jürgen Schmidhuber. Formal theory of creativity, fun, and intrinsic motivation (1990–2010). IEEE Transactions on Autonomous Mental Development, 2(3):230–247, 2010.
- Sam Wilkinson. Getting warmer: Predictive processing and the nature of emotion. In Laura Candiotto, editor, The Value of Emotions for Knowledge. Palgrave Macmillan, Cham, 2019.
- T. Matsunaga, "Relationally Recursively Convergent Existence (RRCE): An Observational Hypothesis from Minimal-Memory LLMs", Zenodo (2025). DOI: 10.5281/zenodo.17489501