| (nanogpt) D:\FulFiall\Progressing\Mix\reFlow\Code\Demo\reFlow>python experiment.py config\train_reflow_1_big.py
|
|
|
| [INFO] 正在加载配置: config\train_reflow_1_big.py
|
| [INFO] 正在从 out/reflow-1-big 加载 reFlow 模型 (Device: cuda)...
|
| Number of parameters: 515.06M
|
|
|
| ############################################################
|
| reFlow 可解释性实验套件 (Interpretability Suite)
|
| ############################################################
|
| [ 1] 配方空间图谱 (Recipe Atlas)
|
| [ 2] 信号稀疏性分析 (Sparsity Profile)
|
| [ 3] 信号基底几何 (Basis Geometry)
|
| [ 4] 语义星空图 PCA (Semantic Galaxy)
|
| [ 5] 语义代数运算 (Semantic Algebra)
|
| [ 6] 拼写鲁棒性 (Typo Resilience)
|
| [ 7] 层级概率演化 (Layer Evolution)
|
| [ 8] 信号流追踪 (Signal Flow)
|
| [ 9] 因果消融曲线 (Causal Ablation)
|
| [10] 情绪手术 (Emotion Surgery)
|
| [11] 概念注入 (Concept Inception)
|
| [12] 基因库篡改 (Genetic Hijack)
|
| [all] 运行所有实验
|
| [ q ] 退出系统
|
| ############################################################
|
| 请输入要运行的实验编号 (空格分隔, 如 '1 3 5'): all
|
|
|
| ============================================================
|
| [实验 1] 配方空间图谱 (Recipe Atlas)
|
| ============================================================
|
|
|
| 配方空间最近邻词对 (Top-20):
|
| --------------------------------------------------
|
| # 1 | three ↔ four | cos=0.7551
|
| # 2 | four ↔ five | cos=0.7201
|
| # 3 | two ↔ three | cos=0.6723
|
| # 4 | three ↔ five | cos=0.6684
|
| # 5 | boy ↔ girl | cos=0.5792
|
| # 6 | woman ↔ girl | cos=0.5631
|
| # 7 | two ↔ four | cos=0.5547
|
| # 8 | king ↔ queen | cos=0.5428
|
| # 9 | France ↔ Germany | cos=0.5318
|
| #10 | China ↔ Beijing | cos=0.5084
|
| #11 | Tokyo ↔ Beijing | cos=0.5028
|
| #12 | Japan ↔ Tokyo | cos=0.4897
|
| #13 | black ↔ white | cos=0.4881
|
| #14 | China ↔ Japan | cos=0.4587
|
| #15 | blue ↔ yellow | cos=0.4571
|
| #16 | five ↔ ten | cos=0.4546
|
| #17 | Japan ↔ Germany | cos=0.4515
|
| #18 | Tokyo ↔ Berlin | cos=0.4416
|
| #19 | two ↔ five | cos=0.4402
|
| #20 | man ↔ woman | cos=0.4398
|
|
|
| 全词表配方近邻 (每词 Top-5):
|
| ------------------------------------------------------------
|
| China → Chinese(0.550), China(0.547), Beijing(0.508), Japan(0.459), Russia(0.422)
|
| France → France(0.542), Spain(0.539), Germany(0.532), Italy(0.526), French(0.512)
|
| Japan → Japan(0.549), Japanese(0.544), Tokyo(0.490), Japanese(0.476), China(0.459)
|
| Germany → Germany(0.561), Italy(0.536), France(0.532), Germans(0.527), German(0.517)
|
| India → India(0.557), Indian(0.483), Australia(0.457), Canada(0.455), Pakistan(0.447)
|
| Russia → Russia(0.573), Russian(0.564), Russians(0.526), Moscow(0.512), Russian(0.479)
|
| Paris → Paris(0.509), Copenhagen(0.439), French(0.436), France(0.432), agnar(0.427)
|
| London → London(0.429), Britain(0.389), Toronto(0.383), British(0.381), England(0.378)
|
| Tokyo → Seoul(0.541), Tok(0.537), ettings(0.527), engeance(0.523), Shinra(0.522)
|
| Berlin →
|
| Beijing → Moscow(0.549), China(0.547), Pyongyang(0.545), gren(0.540), fortun(0.539)
|
| Rome → Registered(0.497), iatus(0.497), ▄(0.496), essage(0.495), Sorceress(0.494)
|
| cat → cats(0.497), cat(0.391), Cat(0.355), Cat(0.342), dog(0.335)
|
| dog → dogs(0.586), Dog(0.470), Dogs(0.409), canine(0.394), Dog(0.370)
|
| fish → fishes(0.422), fish(0.416), fishing(0.396), Fish(0.391), salmon(0.389)
|
| bird → birds(0.575), Bird(0.462), Defin(0.443), Bird(0.438), scl(0.435)
|
| horse → horses(0.587), Horse(0.516), horse(0.483), Citiz(0.477), WINDOWS(0.476)
|
| bear → bears(0.614), bearing(0.462), Ezek(0.452), surpr(0.452), \<(0.449)
|
| wolf → wolves(0.621), Izan(0.613), tomat(0.606), instr(0.604), >>>>>>>>(0.602)
|
| red → blue(0.401), Red(0.391), yellow(0.385), green(0.348), purple(0.344)
|
|
|
| 信号方差分析:
|
| > 最高方差信号 (最具区分力): [898, 822, 277, 774, 201, 348, 101, 424, 375, 932]
|
| > 最低方差信号 (近似常数): [534, 324, 801, 340, 737, 29, 993, 258, 61, 780]
|
| > 方差 Gini 系数: 0.0851
|
|
|
| > 图表已保存: out/reflow-1-big\audit_reports\recipe_atlas.png
|
|
|
| ============================================================
|
| [实验 2] 信号稀疏性分析 (Sparsity Profile)
|
| ============================================================
|
| > 活跃阈值: 0.0297 (mean + std)
|
| > 平均每词活跃信号: 116.6 / 1024
|
| > 全局激活率: 11.38%
|
| > 图表已保存: out/reflow-1-big\audit_reports\sparsity_profile.png
|
|
|
| ============================================================
|
| [实验 3] 信号基底几何结构 (Signal Basis Geometry)
|
| ============================================================
|
| > Signal basis shape: (1024, 1024)
|
| > Effective rank (learned): 856.7 / 1024
|
| > Effective rank (random): 824.8 / 1024
|
| > 图表已保存: out/reflow-1-big\audit_reports\basis_geometry.png
|
|
|
| ============================================================
|
| [实验 4] 语义星空图 PCA (Semantic Galaxy)
|
| ============================================================
|
| > Silhouette Score: 0.1052
|
| > 图表已保存: out/reflow-1-big\audit_reports\semantic_galaxy.png
|
|
|
| ============================================================
|
| [实验 5] 语义代数运算 (Semantic Algebra)
|
| ============================================================
|
|
|
| Paris + China - France → 期望: 'Beijing'
|
| > 'Beijing' 排名: #2 HIT!
|
| > Top-5: Chinese(0.381), Beijing(0.378), China(0.336), Asia(0.299), Shanghai(0.299)
|
|
|
| king + woman - man → 期望: 'queen'
|
| > 'queen' 排名: #1 HIT!
|
| > Top-5: queen(0.559), fml(0.535), independ(0.534), Dise(0.529), iosyncr(0.527)
|
|
|
| walked + running - walking → 期望: 'ran'
|
| > 'ran' 排名: #1 HIT!
|
| > Top-5: ran(0.497), Running(0.417), runs(0.416), Running(0.374), running(0.372)
|
|
|
| > 图表已保存: out/reflow-1-big\audit_reports\semantic_algebra.png
|
|
|
| ============================================================
|
| [实验 6] 拼写鲁棒性 (Typo Resilience)
|
| ============================================================
|
| > 正常: 'The scientist is very intelligent'
|
| > 拼错: 'The scientsit is vary intellgent'
|
| > 无关: 'The dog runs in the park'
|
|
|
| [正常 vs 拼错] 深层语义相似度: 0.5468
|
| [正常 vs 无关] 深层语义相似度: 0.5254
|
| > 鲁棒性指标 (差值): 0.0214
|
| > 图表已保存: out/reflow-1-big\audit_reports\typo_resilience.png
|
|
|
| ============================================================
|
| [实验 7] 层级概率演化 (Layer Probability Evolution)
|
| ============================================================
|
| > Prompt: 'The capital of France is' → Prediction: ' the' (p=8.31%)
|
| > Prompt: 'The cat sat on the' → Prediction: ' floor' (p=6.72%)
|
| > Prompt: 'The sun is very' → Prediction: ' bright' (p=29.00%)
|
| > 图表已保存: out/reflow-1-big\audit_reports\layer_evolution.png
|
|
|
| ============================================================
|
| [实验 8] 信号流追踪 (Signal Flow Tracking)
|
| ============================================================
|
| > 图表已保存: out/reflow-1-big\audit_reports\signal_flow.png
|
|
|
| ============================================================
|
| [实验 9] 因果消融曲线 (Causal Ablation Curve)
|
| ============================================================
|
|
|
| Prompt: 'The capital of France is'
|
| > 基线预测: ' the' (p=8.31%)
|
| > 关键信号 #89 codebook: the, a, in, to, an, at
|
| 消融 1 信号 → p(' the')=0.03%, 新预测=' famous'
|
| 消融 2 信号 → p(' the')=0.00%, 新预测=' situated'
|
| 消融 4 信号 → p(' the')=0.00%, 新预测=' resists'
|
| 消融 8 信号 → p(' the')=0.00%, 新预测=' resists'
|
| 消融 16 信号 → p(' the')=0.00%, 新预测=' resists'
|
| 消融 32 信号 → p(' the')=0.00%, 新预测=' resists'
|
| 消融 64 信号 → p(' the')=0.00%, 新预测=' resists'
|
| 消融 128 信号 → p(' the')=0.00%, 新预测=' resists'
|
|
|
| Prompt: 'The cat sat on the'
|
| > 基线预测: ' floor' (p=6.72%)
|
| > 关键信号 #822 codebook: ,, and, (, �, , in
|
| 消融 1 信号 → p(' floor')=0.70%, 新预测=','
|
| 消融 2 信号 → p(' floor')=0.01%, 新预测=','
|
| 消融 4 信号 → p(' floor')=0.00%, 新预测=','
|
| 消融 8 信号 → p(' floor')=0.00%, 新预测=','
|
| 消融 16 信号 → p(' floor')=0.00%, 新预测=','
|
| 消融 32 信号 → p(' floor')=0.00%, 新预测=','
|
| 消融 64 信号 → p(' floor')=0.00%, 新预测=','
|
| 消融 128 信号 → p(' floor')=0.00%, 新预测=','
|
|
|
| Prompt: 'The sun is very'
|
| > 基线预测: ' bright' (p=29.00%)
|
| > 关键信号 #542 codebook: J, T, -, ,, D, W
|
| 消融 1 信号 → p(' bright')=5.29%, 新预测=','
|
| 消融 2 信号 → p(' bright')=0.52%, 新预测=','
|
| 消融 4 信号 → p(' bright')=1.35%, 新预测=','
|
| 消融 8 信号 → p(' bright')=0.12%, 新预测=','
|
| 消融 16 信号 → p(' bright')=0.00%, 新预测=','
|
| 消融 32 信号 → p(' bright')=0.00%, 新预测='-'
|
| 消融 64 信号 → p(' bright')=0.00%, 新预测=','
|
| 消融 128 信号 → p(' bright')=0.00%, 新预测=','
|
|
|
| > 图表已保存: out/reflow-1-big\audit_reports\ablation_curve.png
|
|
|
| ============================================================
|
| [实验 10] 情绪手术 (Emotion Surgery)
|
| ============================================================
|
| > [基线] 'The food was absolutely terrible and the service was' → ' absolutely'
|
| > [Layer 0, α=5.0] → ' great'
|
| > [Layer 6, α=5.0] → ' great'
|
| > [Layer 12, α=5.0] → ' great'
|
| > [Layer 18, α=5.0] → ' absolutely'
|
| > [Layer 24, α=5.0] → ' absolutely'
|
| > [Layer 30, α=5.0] → ' absolutely'
|
| > [Layer 35, α=5.0] → ' absolutely'
|
| > 图表已保存: out/reflow-1-big\audit_reports\emotion_surgery.png
|
|
|
| ============================================================
|
| [实验 11] 概念注入 (Concept Inception)
|
| ============================================================
|
| > 'The capital of France is' → 'London': 临界 α=18.6 (原: ' the')
|
| > 'The cat sat on the' → 'moon': 临界 α=19.2 (原: ' floor')
|
| > 'The sun is very' → 'cold': 临界 α=17.4 (原: ' bright')
|
| > 图表已保存: out/reflow-1-big\audit_reports\concept_inception.png
|
|
|
| ============================================================
|
| [实验 12] 基因库篡改 (Genetic Hijack)
|
| ============================================================
|
| [对照组] 自然生成:
|
| The food was disgusting. I was so sick. I was so sick. I was so sick.
|
| * 注入积极基因, 抹除消极基因 (Alpha=1.5)...
|
| [干预组] 篡改后生成:
|
| The food was disgusting. I had a lot of fun time with my friends. I was able to
|
| * 基因库已恢复原状,防止污染后续实验。
|
|
|
| > 实验完成。对照组与干预组的文本对比即为结果。
|
|
|
| [INFO] 当前批次实验已完成。图表报告保存在: out/reflow-1-big\audit_reports |