diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/README.md b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5c6f9c8ad92868fe7a45a4ba265a05fb65bd80b4 --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/README.md @@ -0,0 +1,5 @@ +# Issue 41 Mined MLP Substrate-Only Artifacts + +This package contains native and ActDelta repaired substrate-only EN->PT eval outputs for the issue 39 mined MLP final mix. + +Upstream HY-MT and XCOMET model weights are not included. diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/dumps/ntrex/actdelta_rank256_substrate_only.jsonl b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/dumps/ntrex/actdelta_rank256_substrate_only.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..97ccb692c3d7c29939fe430664e6f2beba830a47 --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/dumps/ntrex/actdelta_rank256_substrate_only.jsonl @@ -0,0 +1,1012 @@ +{"id": 0, "en": "Welsh AMs worried about 'looking like muppets'", "pt": "Deputados da Assembleia do País de Gales receiam “passar por Marretas”", "model_hyp": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 1, "en": "There is consternation among some AMs at a suggestion their title should change to MWPs (Member of the Welsh Parliament).", "pt": "Há uma consternação por parte de alguns Deputados da Assembleia do País de Gales (AM) relativamente à sugestão de que o seu título seja alterado para MWP (Deputados do Parlamento Galês).", "model_hyp": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 2, "en": "It has arisen because of plans to change the name of the assembly to the Welsh Parliament.", "pt": "A origem desta controvérsia está nos planos para alterar o nome da assembleia para \"Parlamento Galês\".", "model_hyp": "逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 3, "en": "AMs across the political spectrum are worried it could invite ridicule.", "pt": "Alguns membros dessa assembleia, provenientes de todas as cores políticas, receiam que tal os faça cair no ridículo.", "model_hyp": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 4, "en": "One Labour AM said his group was concerned \"it rhymes with Twp and Pwp.\"", "pt": "Um AM trabalhista afirmou que o grupo está preocupado com o facto de “a designação rimar com Twp e Pwp\".", "model_hyp": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 5, "en": "For readers outside of Wales: In Welsh twp means daft and pwp means poo.", "pt": "Para os leitores não galeses: na língua galesa, “twp” significa “idiota” e pwp significa “excrementos”.", "model_hyp": "逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 6, "en": "A Plaid AM said the group as a whole was \"not happy\" and has suggested alternatives.", "pt": "Um AM do Plaid afirmou que o grupo na sua globalidade “não estava contente” e sugeriu alternativas.", "model_hyp": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 7, "en": "A Welsh Conservative said his group was \"open minded\" about the name change, but noted it was a short verbal hop from MWP to Muppet.", "pt": "Um deputado conservador galês afirmou que o grupo estava de “mente aberta” em relação à alteração do nome, mas referiu que a designação MWP estava verbalmente muito próxima de Muppet (Marreta).", "model_hyp": "...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 8, "en": "In this context The Welsh letter w is pronounced similarly to the Yorkshire English pronunciation of the letter u.", "pt": "Neste contexto, a letra w em galês tem uma pronúncia semelhante à da letra u no inglês de Yorkshire.", "model_hyp": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 9, "en": "The Assembly Commission, which is currently drafting legislation to introduce the name changes, said: \"The final decision on any descriptors of what Assembly Members are called will of course be a matter for the members themselves.\"", "pt": "A Comissão da Assembleia, atualmente a elaborar legislação para introduzir as alterações de nome, declarou: \"A decisão final sobre a forma como os Deputados da Assembleia são designados será obviamente tomada pelos próprios\".", "model_hyp": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 10, "en": "The Government of Wales Act 2017 gave the Welsh assembly the power to change its name.", "pt": "A Lei do Governo do País de Gales de 2017 deu à sua assembleia os poderes para mudar de nome.", "model_hyp": "高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 11, "en": "In June, the Commission published the results of a public consultation on the proposals which found broad support for calling the assembly a Welsh Parliament.", "pt": "Em junho, a Comissão publicou os resultados de uma consulta pública sobre as propostas, a qual registou um apoio generalizado à proposta de designar a assembleia por \"Parlamento Galês\".", "model_hyp": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 12, "en": "On the matter of the AMs' title, the Commission favoured Welsh Parliament Members or WMPs, but the MWP option received the most support in a public consultation.", "pt": "Sobre a questão do título dos AM, a Comissão favoreceu \"Deputados do Parlamento Galês”, ou WMP, mas a opção MWP foi mais favorecida numa consulta pública.", "model_hyp": "逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐", "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"} +{"id": 13, "en": "AMs are apparently suggesting alternative options, but the struggle to reach consensus could be a headache for the Presiding Officer, Elin Jones, who is expected to submit draft legislation on the changes within weeks.", "pt": "Aparentemente, os AM estão a sugerir alternativas, mas o esforço para reunir o consenso pode constituir uma dor de cabeça para o Presidente, Elin Jones, que deverá apresentar um projeto de legislação sobre as alterações dentro de algumas semanas.", "model_hyp": "... torch.dtype: + return { + "float32": torch.float32, + "float16": torch.float16, + "bfloat16": torch.bfloat16, + }[name] + + +def mlp_total(n_layers: int, d_ffn: int) -> int: + return int(n_layers) * int(d_ffn) + + +def flat_to_layer_channel(flat_idx: int, d_ffn: int) -> tuple[int, int]: + return int(flat_idx) // int(d_ffn), int(flat_idx) % int(d_ffn) + + +def sector_ranges(total: int, sectors: int) -> list[tuple[int, int]]: + return [ + (int(total * i // sectors), int(total * (i + 1) // sectors)) + for i in range(sectors) + ] + + +def split_range(start: int, end: int, parts: int) -> list[tuple[int, int]]: + size = end - start + return [ + (start + int(size * i // parts), start + int(size * (i + 1) // parts)) + for i in range(parts) + ] + + +def normalize_ranges(ranges: Iterable[tuple[int, int]]) -> tuple[tuple[int, int], ...]: + out = [] + for start, end in ranges: + start = int(start) + end = int(end) + if end > start: + out.append((start, end)) + return tuple(out) + + +def mask_from_ranges(ranges: Iterable[tuple[int, int]], n_layers: int, + d_ffn: int) -> dict[int, torch.Tensor]: + mask = {layer: torch.zeros(d_ffn, dtype=torch.bool) for layer in range(n_layers)} + total = mlp_total(n_layers, d_ffn) + for raw_start, raw_end in ranges: + start = max(0, int(raw_start)) + end = min(total, int(raw_end)) + for flat in range(start, end): + layer, channel = flat_to_layer_channel(flat, d_ffn) + mask[layer][channel] = True + return mask + + +def count_mask(mask: dict[int, torch.Tensor]) -> int: + return int(sum(int(v.sum().item()) for v in mask.values())) + + +def mask_to_ranges(mask: dict[int, torch.Tensor], d_ffn: int) -> list[tuple[int, int]]: + flats: list[int] = [] + for layer, values in sorted(mask.items()): + idx = torch.nonzero(values.cpu(), as_tuple=False).flatten().tolist() + flats.extend([int(layer) * d_ffn + int(i) for i in idx]) + if not flats: + return [] + flats.sort() + ranges: list[tuple[int, int]] = [] + start = prev = flats[0] + for flat in flats[1:]: + if flat == prev + 1: + prev = flat + continue + ranges.append((start, prev + 1)) + start = prev = flat + ranges.append((start, prev + 1)) + return ranges + + +def load_candidate_jsonl(path: str | Path) -> list[dict[str, Any]]: + rows: list[dict[str, Any]] = [] + with Path(path).open() as f: + for line in f: + if line.strip(): + rows.append(json.loads(line)) + return rows + + +def write_jsonl(path: str | Path, rows: Iterable[dict[str, Any]]) -> None: + out = Path(path) + out.parent.mkdir(parents=True, exist_ok=True) + with out.open("w") as f: + for row in rows: + f.write(json.dumps(row, ensure_ascii=False) + "\n") + + +def load_pairs(path: str | None, *, src_lang: str = "eng_Latn", + tgt_lang: str = "por_Latn", max_rows: int | None = None) -> list[Pair]: + if path is None: + return load_flores_devtest_any( + src_lang=src_lang, + tgt_lang=tgt_lang, + max_examples=max_rows, + ) + rows: list[Pair] = [] + with Path(path).open() as f: + for line in f: + if not line.strip(): + continue + raw = json.loads(line) + src = (raw.get("en") or raw.get("src") or "").strip() + tgt = (raw.get("model_hyp") or raw.get("pt") or raw.get("tgt") or "").strip() + if src and tgt: + rows.append(Pair(src=src, tgt=tgt)) + if max_rows is not None and len(rows) >= max_rows: + break + return rows + + +def build_supervised_examples(pairs: list[Pair], tokenizer, *, target_language: str, + prompt_style: str = DEFAULT_PROMPT_STYLE, + max_seq_length: int = 1024) -> list[dict[str, Any]]: + examples: list[dict[str, Any]] = [] + for pair in pairs: + row = {"en": pair.src, "target": pair.tgt, "raw": {"en": pair.src, "pt": pair.tgt}} + enc = encode_supervised_row( + row, + tokenizer, + target_language=target_language, + prompt_style=prompt_style, + max_seq_length=max_seq_length, + kl_on="answer", + ) + if enc is not None: + examples.append(enc) + return examples + + +def iter_batches(examples: list[dict[str, Any]], *, batch_size: int, pad_id: int): + for start in range(0, len(examples), batch_size): + yield collate_translation(examples[start:start + batch_size], pad_id) + + +def move_batch(batch: dict[str, Any], device: str) -> dict[str, Any]: + return {k: v.to(device) if torch.is_tensor(v) else v for k, v in batch.items()} + + +def tokenwise_kl(teacher_logits: torch.Tensor, student_logits: torch.Tensor, + logit_mask: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]: + mask = logit_mask[:, :-1] + t_logits = teacher_logits[:, :-1, :] + s_logits = student_logits[:, :-1, :] + log_t = F.log_softmax(t_logits, dim=-1) + prob_t = log_t.exp() + log_s = F.log_softmax(s_logits, dim=-1) + kl = (prob_t * (log_t - log_s)).sum(dim=-1) + return kl, mask + + +def sentence_kl_values(teacher_logits: torch.Tensor, student_logits: torch.Tensor, + logit_mask: torch.Tensor) -> list[float]: + kl, mask = tokenwise_kl(teacher_logits, student_logits, logit_mask) + values: list[float] = [] + for row_idx in range(kl.shape[0]): + row_mask = mask[row_idx] + if bool(row_mask.any().item()): + values.append(float(kl[row_idx][row_mask].mean().detach().cpu().item())) + else: + values.append(0.0) + return values + + +def install_mlp_nuke_hooks(model, nuke_mask: dict[int, torch.Tensor], + *, device: str, dtype: torch.dtype) -> list[Any]: + hooks: list[Any] = [] + root = decoder_root(model) + for layer_idx, layer in enumerate(root.layers): + selected = nuke_mask[layer_idx].to(device) + if not bool(selected.any().item()): + continue + keep = (~selected).to(dtype=dtype).view(1, 1, -1) + + def make_hook(keep: torch.Tensor): + def hook_fn(module, hook_args): + act = hook_args[0] + return (act * keep,) + hook_args[1:] + return hook_fn + + hooks.append(layer.mlp.down_proj.register_forward_pre_hook(make_hook(keep))) + return hooks + + +def install_mlp_keep_only_hooks(model, keep_mask: dict[int, torch.Tensor], + *, device: str, dtype: torch.dtype) -> list[Any]: + """Keep selected MLP down-proj input channels and zero every other MLP channel.""" + hooks: list[Any] = [] + root = decoder_root(model) + for layer_idx, layer in enumerate(root.layers): + keep = keep_mask[layer_idx].to(device=device, dtype=dtype).view(1, 1, -1) + + def make_hook(keep: torch.Tensor): + def hook_fn(module, hook_args): + act = hook_args[0] + return (act * keep,) + hook_args[1:] + return hook_fn + + hooks.append(layer.mlp.down_proj.register_forward_pre_hook(make_hook(keep))) + return hooks + + +def save_mask_for_candidate(out_dir: Path, candidate: Candidate, n_layers: int, + d_ffn: int) -> str: + mask = mask_from_ranges(candidate.ranges, n_layers, d_ffn) + path = out_dir / f"{candidate.name}.full.npz" + save_mask_npz(path, mask) + return str(path) + + +def model_mlp_shape(model) -> tuple[int, int, int]: + cfg = text_config(model) + return int(cfg.num_hidden_layers), int(cfg.hidden_size), int(cfg.intermediate_size) diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/evaluate_actdelta_lora_translation.py b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/evaluate_actdelta_lora_translation.py new file mode 100644 index 0000000000000000000000000000000000000000..06d16403ebf00641f0085d144d07f6f63f219d80 --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/evaluate_actdelta_lora_translation.py @@ -0,0 +1,216 @@ +#!/usr/bin/env python3 +"""Evaluate ActDeltaLoRA restoration for a nuked MLP final mix.""" + +from __future__ import annotations + +import argparse +import json +import time +from pathlib import Path +from typing import Any + +import sacrebleu +import torch +from transformers import AutoModelForCausalLM, AutoTokenizer + +from actdelta_mlp_common import count_mask, dtype_from_name, load_pairs, model_mlp_shape +from translation_io import DEFAULT_PROMPT_STYLE, generate_translations +from translation_region_student import decoder_root, load_mask_npz + + +def parse_args() -> argparse.Namespace: + p = argparse.ArgumentParser(description=__doc__) + p.add_argument("--model", default="tencent/HY-MT1.5-1.8B") + p.add_argument("--mask", required=True) + p.add_argument("--factor-dir", required=True) + p.add_argument("--out-json", required=True) + p.add_argument("--dump-hyps", required=True) + p.add_argument("--input-jsonl", default=None) + p.add_argument("--max-rows", type=int, default=None) + p.add_argument("--start-idx", type=int, default=0) + p.add_argument("--end-idx", type=int, default=None) + p.add_argument("--batch-size", type=int, default=32) + p.add_argument("--max-new-tokens", type=int, default=384) + p.add_argument("--target-language", default="Portuguese") + p.add_argument("--prompt-style", default=DEFAULT_PROMPT_STYLE) + p.add_argument("--src-lang", default="eng_Latn") + p.add_argument("--tgt-lang", default="por_Latn") + p.add_argument("--device", default="cuda") + p.add_argument("--dtype", default="bfloat16", choices=["float32", "float16", "bfloat16"]) + p.add_argument("--category", default="actdelta_eval") + p.add_argument("--tag", default="heldout") + p.add_argument("--system-name", default=None) + p.add_argument("--substrate-only", action="store_true", + help="Write reconstructed selected channels and zero every other MLP channel.") + return p.parse_args() + + +class ActDeltaController: + def __init__(self, payload: dict[str, Any], *, device: str, dtype: torch.dtype): + self.selected_indices = { + int(layer): torch.tensor(indices, dtype=torch.long) + for layer, indices in payload["selected_indices"].items() + } + self.layers = {} + for layer, data in payload["layers"].items(): + self.layers[int(layer)] = { + "P": data["P"].to(device=device, dtype=torch.float32), + "B": data["B"].to(device=device, dtype=torch.float32), + } + self.device = device + self.dtype = dtype + + def install(self, model, *, substrate_only: bool = False): + hooks = [] + root = decoder_root(model) + hidden_cache: dict[int, torch.Tensor] = {} + layer_indices = range(len(root.layers)) if substrate_only else self.layers.keys() + for layer_idx in layer_indices: + layer = root.layers[layer_idx] + factors = self.layers.get(layer_idx) + selected_cpu = self.selected_indices.get(layer_idx) + + def make_mlp_pre(idx: int): + def hook_fn(module, hook_args): + hidden_cache[idx] = hook_args[0].detach() + return hook_fn + + def make_zero_down_pre(): + def hook_fn(module, hook_args): + return (torch.zeros_like(hook_args[0]),) + hook_args[1:] + return hook_fn + + def make_down_pre(idx: int, selected_cpu: torch.Tensor, p: torch.Tensor, + b: torch.Tensor, substrate_only: bool): + def hook_fn(module, hook_args): + act = hook_args[0] + hidden = hidden_cache.get(idx) + if hidden is None: + raise RuntimeError(f"missing MLP input cache for layer {idx}") + selected = selected_cpu.to(act.device) + coeff = hidden.to(torch.float32) @ p + delta = (coeff @ b).to(dtype=act.dtype) + patched = torch.zeros_like(act) if substrate_only else act.clone() + patched[..., selected] = delta + return (patched,) + hook_args[1:] + return hook_fn + + if factors is None or selected_cpu is None: + hooks.append(layer.mlp.down_proj.register_forward_pre_hook(make_zero_down_pre())) + continue + + hooks.append(layer.mlp.register_forward_pre_hook(make_mlp_pre(layer_idx))) + hooks.append(layer.mlp.down_proj.register_forward_pre_hook( + make_down_pre(layer_idx, selected_cpu, factors["P"], factors["B"], substrate_only) + )) + return hooks + + +def score(hyps: list[str], refs: list[str]) -> dict: + return { + "chrFpp": float(sacrebleu.corpus_chrf(hyps, [refs], word_order=2).score), + "chrF": float(sacrebleu.corpus_chrf(hyps, [refs], word_order=0).score), + "BLEU": float(sacrebleu.corpus_bleu(hyps, [refs]).score), + "n": len(hyps), + } + + +def main() -> None: + args = parse_args() + dtype = dtype_from_name(args.dtype) + out_path = Path(args.out_json) + dump_path = Path(args.dump_hyps) + out_path.parent.mkdir(parents=True, exist_ok=True) + dump_path.parent.mkdir(parents=True, exist_ok=True) + + tokenizer = AutoTokenizer.from_pretrained(args.model) + if tokenizer.pad_token_id is None: + tokenizer.pad_token = tokenizer.eos_token + model = AutoModelForCausalLM.from_pretrained( + args.model, + dtype=dtype, + attn_implementation="eager", + ).to(args.device).eval() + model.config.use_cache = True + for param in model.parameters(): + param.requires_grad_(False) + + n_layers, hidden_size, d_ffn = model_mlp_shape(model) + mask = load_mask_npz(args.mask, n_layers, d_ffn) + payload = torch.load(Path(args.factor_dir) / "actdelta_lora.pt", map_location="cpu") + cfg = json.load(open(Path(args.factor_dir) / "config.json")) + controller = ActDeltaController(payload, device=args.device, dtype=dtype) + + all_pairs = load_pairs( + args.input_jsonl, + src_lang=args.src_lang, + tgt_lang=args.tgt_lang, + max_rows=None, + ) + end_idx = args.end_idx if args.end_idx is not None else len(all_pairs) + pairs = all_pairs[args.start_idx:end_idx] + if args.max_rows is not None: + pairs = pairs[:args.max_rows] + sources = [pair.src for pair in pairs] + refs = [pair.tgt for pair in pairs] + + t0 = time.time() + hooks = controller.install(model, substrate_only=args.substrate_only) + try: + hyps = generate_translations( + model, + tokenizer, + sources, + target_language=args.target_language, + prompt_style=args.prompt_style, + batch_size=args.batch_size, + max_new_tokens=args.max_new_tokens, + do_sample=False, + device=args.device, + ) + finally: + for hook in hooks: + hook.remove() + scores = score(hyps, refs) + elapsed_s = time.time() - t0 + + system_name = args.system_name or f"actdelta_rank_{cfg.get('rank')}" + method = "actdelta_lora_mlp_substrate_only" if args.substrate_only else "actdelta_lora_mlp_restore" + with dump_path.open("w") as f: + for idx, (pair, hyp) in enumerate(zip(pairs, hyps)): + f.write(json.dumps({ + "id": args.start_idx + idx, + "en": pair.src, + "pt": pair.tgt, + "model_hyp": hyp, + "category": args.category, + "tag": args.tag, + "mask_name": system_name, + "method": method, + "substrate_only": args.substrate_only, + "rank": cfg.get("rank"), + "channels": count_mask(mask), + "factor_dir": args.factor_dir, + }, ensure_ascii=False) + "\n") + + out = { + "model": args.model, + "mask": args.mask, + "factor_dir": args.factor_dir, + "rank": cfg.get("rank"), + "parameter_count": cfg.get("parameter_count"), + "channels": count_mask(mask), + "substrate_only": args.substrate_only, + "scores": scores, + "elapsed_s": elapsed_s, + "dump_hyps": str(dump_path), + "n_layers": n_layers, + "hidden_size": hidden_size, + "d_ffn": d_ffn, + } + out_path.write_text(json.dumps(out, indent=2, ensure_ascii=False) + "\n") + print(json.dumps({"system": system_name, "scores": scores}, indent=2), flush=True) + + +if __name__ == "__main__": + main() diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/evaluate_mlp_nuke_translation.py b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/evaluate_mlp_nuke_translation.py new file mode 100644 index 0000000000000000000000000000000000000000..24415550411211231db9143eb3e1a865762d655f --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/evaluate_mlp_nuke_translation.py @@ -0,0 +1,212 @@ +#!/usr/bin/env python3 +"""Evaluate HY-MT EN->PT generation with selected MLP channels zero-nuked.""" + +from __future__ import annotations + +import argparse +import json +import time +from pathlib import Path + +import sacrebleu +import torch +from transformers import AutoModelForCausalLM, AutoTokenizer + +from actdelta_mlp_common import ( + count_mask, + dtype_from_name, + install_mlp_keep_only_hooks, + install_mlp_nuke_hooks, + load_pairs, + model_mlp_shape, +) +from translation_io import DEFAULT_PROMPT_STYLE, generate_translations +from translation_region_student import load_mask_npz + + +def parse_args() -> argparse.Namespace: + p = argparse.ArgumentParser(description=__doc__) + p.add_argument("--model", default="tencent/HY-MT1.5-1.8B") + p.add_argument("--mask", action="append", default=[], metavar="NAME:PATH") + p.add_argument("--out-json", required=True) + p.add_argument("--dump-dir", required=True) + p.add_argument("--input-jsonl", default=None) + p.add_argument("--max-rows", type=int, default=None) + p.add_argument("--start-idx", type=int, default=0) + p.add_argument("--end-idx", type=int, default=None) + p.add_argument("--batch-size", type=int, default=32) + p.add_argument("--max-new-tokens", type=int, default=384) + p.add_argument("--target-language", default="Portuguese") + p.add_argument("--prompt-style", default=DEFAULT_PROMPT_STYLE) + p.add_argument("--src-lang", default="eng_Latn") + p.add_argument("--tgt-lang", default="por_Latn") + p.add_argument("--device", default="cuda") + p.add_argument("--dtype", default="bfloat16", choices=["float32", "float16", "bfloat16"]) + p.add_argument("--include-no-mask", action="store_true") + p.add_argument("--intervention", default="nuke-zero", choices=["nuke-zero", "keep-only"], + help="nuke-zero zeros selected channels; keep-only zeros every non-selected MLP channel.") + p.add_argument("--category", default="actdelta_eval") + p.add_argument("--tag", default="heldout") + return p.parse_args() + + +def parse_mask_specs(values: list[str]) -> list[tuple[str, Path]]: + out = [] + for value in values: + if ":" not in value: + raise ValueError(f"--mask must be NAME:PATH, got {value!r}") + name, path = value.split(":", 1) + out.append((name, Path(path))) + return out + + +def dump_hyps(path: Path, pairs, hyps: list[str], *, mask_name: str, extra: dict) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + with path.open("w") as f: + for idx, (pair, hyp) in enumerate(zip(pairs, hyps)): + f.write(json.dumps({ + "id": idx, + "en": pair.src, + "pt": pair.tgt, + "model_hyp": hyp, + "category": extra.get("category", "actdelta_eval"), + "tag": extra.get("tag", "heldout"), + "mask_name": mask_name, + **{k: v for k, v in extra.items() if k not in {"category", "tag"}}, + }, ensure_ascii=False) + "\n") + + +def score(hyps: list[str], refs: list[str]) -> dict: + return { + "chrFpp": float(sacrebleu.corpus_chrf(hyps, [refs], word_order=2).score), + "chrF": float(sacrebleu.corpus_chrf(hyps, [refs], word_order=0).score), + "BLEU": float(sacrebleu.corpus_bleu(hyps, [refs]).score), + "n": len(hyps), + } + + +def main() -> None: + args = parse_args() + dtype = dtype_from_name(args.dtype) + out_path = Path(args.out_json) + dump_dir = Path(args.dump_dir) + out_path.parent.mkdir(parents=True, exist_ok=True) + dump_dir.mkdir(parents=True, exist_ok=True) + + tokenizer = AutoTokenizer.from_pretrained(args.model) + if tokenizer.pad_token_id is None: + tokenizer.pad_token = tokenizer.eos_token + model = AutoModelForCausalLM.from_pretrained( + args.model, + dtype=dtype, + attn_implementation="eager", + ).to(args.device).eval() + model.config.use_cache = True + for param in model.parameters(): + param.requires_grad_(False) + + n_layers, hidden_size, d_ffn = model_mlp_shape(model) + all_pairs = load_pairs( + args.input_jsonl, + src_lang=args.src_lang, + tgt_lang=args.tgt_lang, + max_rows=None, + ) + end_idx = args.end_idx if args.end_idx is not None else len(all_pairs) + pairs = all_pairs[args.start_idx:end_idx] + if args.max_rows is not None: + pairs = pairs[:args.max_rows] + sources = [pair.src for pair in pairs] + refs = [pair.tgt for pair in pairs] + + results = {} + if args.include_no_mask: + t0 = time.time() + hyps = generate_translations( + model, + tokenizer, + sources, + target_language=args.target_language, + prompt_style=args.prompt_style, + batch_size=args.batch_size, + max_new_tokens=args.max_new_tokens, + do_sample=False, + device=args.device, + ) + scores = score(hyps, refs) + dump_path = dump_dir / "no_mask.jsonl" + dump_hyps(dump_path, pairs, hyps, mask_name="no_mask", + extra={"category": args.category, "tag": args.tag, "method": "no_mask"}) + results["no_mask"] = { + "scores": scores, + "elapsed_s": time.time() - t0, + "dump_path": str(dump_path), + "channels": 0, + } + print(json.dumps({"name": "no_mask", "scores": scores}), flush=True) + + for name, mask_path in parse_mask_specs(args.mask): + mask = load_mask_npz(mask_path, n_layers, d_ffn) + channels = count_mask(mask) + t0 = time.time() + if args.intervention == "nuke-zero": + hooks = install_mlp_nuke_hooks(model, mask, device=args.device, dtype=dtype) + method = "mlp_nuke_zero" + else: + hooks = install_mlp_keep_only_hooks(model, mask, device=args.device, dtype=dtype) + method = "mlp_keep_only_zero" + try: + hyps = generate_translations( + model, + tokenizer, + sources, + target_language=args.target_language, + prompt_style=args.prompt_style, + batch_size=args.batch_size, + max_new_tokens=args.max_new_tokens, + do_sample=False, + device=args.device, + ) + finally: + for hook in hooks: + hook.remove() + scores = score(hyps, refs) + dump_path = dump_dir / f"{name}.jsonl" + dump_hyps( + dump_path, + pairs, + hyps, + mask_name=name, + extra={ + "category": args.category, + "tag": args.tag, + "method": method, + "intervention": args.intervention, + "channels": channels, + "mask_path": str(mask_path), + }, + ) + results[name] = { + "scores": scores, + "elapsed_s": time.time() - t0, + "dump_path": str(dump_path), + "channels": channels, + "mask_path": str(mask_path), + "intervention": args.intervention, + } + print(json.dumps({"name": name, "channels": channels, "scores": scores}), flush=True) + + payload = { + "model": args.model, + "n_layers": n_layers, + "hidden_size": hidden_size, + "d_ffn": d_ffn, + "row_slice": {"start_idx": args.start_idx, "end_idx": end_idx}, + "n_rows": len(pairs), + "results": results, + } + out_path.write_text(json.dumps(payload, indent=2, ensure_ascii=False) + "\n") + + +if __name__ == "__main__": + main() diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/issue41_substrate_only_runner.sh b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/issue41_substrate_only_runner.sh new file mode 100644 index 0000000000000000000000000000000000000000..af4e8c68fbb752681b31a3b22e6d8c3355bb73fa --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/issue41_substrate_only_runner.sh @@ -0,0 +1,252 @@ +#!/usr/bin/env bash +# Issue #41 native and ActDelta substrate-only EN->PT eval runner. +set -euo pipefail + +export TOKENIZERS_PARALLELISM="${TOKENIZERS_PARALLELISM:-false}" +export TORCH_ALLOW_TF32_CUBLAS_OVERRIDE="${TORCH_ALLOW_TF32_CUBLAS_OVERRIDE:-1}" + +REPO_DIR="${REPO_DIR:-/root/work/circuit-shotting}" +cd "$REPO_DIR" + +MODEL="${MODEL:-tencent/HY-MT1.5-1.8B}" +RUN_ROOT="${RUN_ROOT:-/root/runs/issue41_mined_substrate_only}" +ARTIFACT_REPO="${ARTIFACT_REPO:-TokenBender/circuit-discovery}" +ARTIFACT_PREFIX="${ARTIFACT_PREFIX:-circuit-shotting/artifacts/actdelta_lora_mlp_mvc/issue39_actdelta_lora_mlp_mvc_20260518T011201Z}" +ARTIFACT_DIR="${ARTIFACT_DIR:-$RUN_ROOT/source_issue39}" +NTREX_JSONL="${NTREX_JSONL:-/root/runs/ntrex_eval/ntrex_en2pt.jsonl}" +GPU_LIST="${GPU_LIST:-}" +EVAL_MAX_ROWS="${EVAL_MAX_ROWS:-}" +BATCH_SIZE_GEN="${BATCH_SIZE_GEN:-32}" +XCOMET_SERVICE_BASE_PORT="${XCOMET_SERVICE_BASE_PORT:-10001}" +XCOMET_BATCH_SIZE="${XCOMET_BATCH_SIZE:-4}" +XCOMET_CHUNK_SIZE="${XCOMET_CHUNK_SIZE:-16}" +XCOMET_SERVICE_LOAD_TIMEOUT_S="${XCOMET_SERVICE_LOAD_TIMEOUT_S:-1800}" +BASELINE_XCOMET="${BASELINE_XCOMET:-0.9287162019683438}" +UPLOAD_AFTER="${UPLOAD_AFTER:-0}" + +mkdir -p "$RUN_ROOT"/{logs,eval,dumps,xcomet,xcomet_shards,services,summaries,package} + +mark() { + echo "[$(date -Iseconds)] $*" | tee -a "$RUN_ROOT/logs/issue41_progress.log" +} + +detect_gpus() { + if [[ -n "$GPU_LIST" ]]; then + echo "$GPU_LIST" | tr ',' ' ' + return + fi + nvidia-smi --query-gpu=index --format=csv,noheader | tr '\n' ' ' +} + +read -r -a GPU_ARRAY <<<"$(detect_gpus)" +GPU_COUNT="${#GPU_ARRAY[@]}" +if ((GPU_COUNT < 1)); then + echo "no GPUs found" >&2 + exit 2 +fi + +MASK="$ARTIFACT_DIR/selection/chunks/masks/final_mix_top_3.full.npz" +FACTOR_DIR="$ARTIFACT_DIR/factors/rank_256" + +download_artifacts() { + if [[ -f "$MASK" && -f "$FACTOR_DIR/actdelta_lora.pt" && -f "$FACTOR_DIR/config.json" ]]; then + return 0 + fi + mark "download preserved issue39 final mask and rank256 factors" + python3 - "$ARTIFACT_REPO" "$ARTIFACT_PREFIX" "$ARTIFACT_DIR" <<'PY' +import shutil +import sys +from pathlib import Path +from huggingface_hub import hf_hub_download + +repo, prefix, artifact_dir = sys.argv[1], sys.argv[2], Path(sys.argv[3]) +files = [ + "selection/chunks/masks/final_mix_top_3.full.npz", + "factors/rank_256/actdelta_lora.pt", + "factors/rank_256/config.json", +] +for rel in files: + src = Path(hf_hub_download(repo_id=repo, repo_type="dataset", filename=f"{prefix}/{rel}")) + dst = artifact_dir / rel + dst.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(src, dst) + print(dst) +PY +} + +build_ntrex() { + if [[ -f "$NTREX_JSONL" ]]; then + return 0 + fi + mark "build NTREX EN->PT held-out jsonl" + python3 build_ntrex_en2pt_jsonl.py > "$RUN_ROOT/logs/build_ntrex.log" 2>&1 +} + +eval_native() { + if [[ -s "$RUN_ROOT/eval/native_substrate_only.json" ]]; then + return 0 + fi + mark "eval native mined-substrate-only" + CUDA_VISIBLE_DEVICES="${GPU_ARRAY[0]}" python3 evaluate_mlp_nuke_translation.py \ + --model "$MODEL" \ + --input-jsonl "$NTREX_JSONL" \ + --out-json "$RUN_ROOT/eval/native_substrate_only.json" \ + --dump-dir "$RUN_ROOT/dumps/ntrex" \ + --mask "native_mined_substrate_only:$MASK" \ + --intervention keep-only \ + ${EVAL_MAX_ROWS:+--max-rows "$EVAL_MAX_ROWS"} \ + --batch-size "$BATCH_SIZE_GEN" \ + --category "ntrex_test" \ + --tag "heldout" \ + > "$RUN_ROOT/logs/eval_native_substrate_only.log" 2>&1 +} + +eval_actdelta() { + if [[ -s "$RUN_ROOT/eval/actdelta_rank256_substrate_only.json" ]]; then + return 0 + fi + mark "eval ActDelta rank256 repair-substrate-only" + CUDA_VISIBLE_DEVICES="${GPU_ARRAY[0]}" python3 evaluate_actdelta_lora_translation.py \ + --model "$MODEL" \ + --mask "$MASK" \ + --factor-dir "$FACTOR_DIR" \ + --input-jsonl "$NTREX_JSONL" \ + --out-json "$RUN_ROOT/eval/actdelta_rank256_substrate_only.json" \ + --dump-hyps "$RUN_ROOT/dumps/ntrex/actdelta_rank256_substrate_only.jsonl" \ + ${EVAL_MAX_ROWS:+--max-rows "$EVAL_MAX_ROWS"} \ + --batch-size "$BATCH_SIZE_GEN" \ + --category "ntrex_test" \ + --tag "heldout" \ + --system-name "actdelta_rank256_substrate_only" \ + --substrate-only \ + > "$RUN_ROOT/logs/eval_actdelta_rank256_substrate_only.log" 2>&1 +} + +start_xcomet_service() { + local service_idx="$1" + local gpu="$2" + local port="$3" + local service_root="$RUN_ROOT/services/xcomet_${service_idx}" + mkdir -p "$service_root" + if [[ ! -s "$service_root/service.token" ]]; then + python3 - "$service_root/service.token" <<'PY' +import secrets, sys +from pathlib import Path +p = Path(sys.argv[1]) +p.write_text(secrets.token_urlsafe(32)) +p.chmod(0o600) +PY + fi + if [[ -s "$service_root/service.pid" ]] && kill -0 "$(cat "$service_root/service.pid")" 2>/dev/null; then + return 0 + fi + mark "start XCOMET service idx=$service_idx gpu=$gpu port=$port" + CUDA_VISIBLE_DEVICES="$gpu" XCOMET_SERVICE_TOKEN="$(cat "$service_root/service.token")" \ + nohup python3 xcomet_service.py \ + --host 0.0.0.0 --port "$port" \ + --comet-model "${XCOMET_MODEL:-Unbabel/XCOMET-XXL}" \ + --run-root "$service_root" \ + --default-batch-size "$XCOMET_BATCH_SIZE" \ + --default-chunk-size "$XCOMET_CHUNK_SIZE" \ + --max-worker-batch-size "$XCOMET_BATCH_SIZE" \ + --max-batch-rows "$XCOMET_CHUNK_SIZE" \ + --max-batch-wait-ms 100 \ + --max-queue-rows 4096 \ + --queue-timeout-s 7200 \ + --float32-matmul-precision high \ + --load-on-start \ + > "$service_root/service.log" 2>&1 & + echo "$!" > "$service_root/service.pid" +} + +wait_xcomet_service() { + local service_idx="$1" + local port="$2" + local service_root="$RUN_ROOT/services/xcomet_${service_idx}" + local start_ts now elapsed + start_ts="$(date +%s)" + while true; do + if [[ -s "$service_root/service.pid" ]] && ! kill -0 "$(cat "$service_root/service.pid")" 2>/dev/null; then + tail -n 200 "$service_root/service.log" >&2 || true + return 1 + fi + if curl -fsS -H "Authorization: Bearer $(cat "$service_root/service.token")" \ + "http://127.0.0.1:${port}/health" > "$service_root/health.json" 2>/dev/null; then + if grep -q '"model_loaded": true' "$service_root/health.json"; then + mark "XCOMET service idx=$service_idx healthy on port=$port" + return 0 + fi + fi + now="$(date +%s)" + elapsed=$((now - start_ts)) + if ((elapsed > XCOMET_SERVICE_LOAD_TIMEOUT_S)); then + tail -n 200 "$service_root/service.log" >&2 || true + return 1 + fi + sleep 15 + done +} + +start_xcomet_services() { + mark "start $GPU_COUNT XCOMET services sequentially" + for ((j=0; j "$RUN_ROOT/logs/xcomet_${name}.log" 2>&1 +} + +score_xcomet() { + start_xcomet_services + score_xcomet_name "native_mined_substrate_only" "$RUN_ROOT/dumps/ntrex/native_mined_substrate_only.jsonl" + score_xcomet_name "actdelta_rank256_substrate_only" "$RUN_ROOT/dumps/ntrex/actdelta_rank256_substrate_only.jsonl" +} + +summarize() { + mark "summarize issue41" + python3 summarize_issue41_substrate_only.py \ + --run-root "$RUN_ROOT" \ + --baseline-xcomet "$BASELINE_XCOMET" \ + --out-json "$RUN_ROOT/summaries/issue41_summary.json" \ + --out-md "$RUN_ROOT/summaries/issue41_summary.md" \ + > "$RUN_ROOT/logs/summarize_issue41.log" 2>&1 +} + +mark "issue41 start substrate-only eval gpus=${GPU_ARRAY[*]}" +download_artifacts +build_ntrex +eval_native +eval_actdelta +score_xcomet +summarize +if [[ "$UPLOAD_AFTER" == "1" || "$UPLOAD_AFTER" == "true" ]]; then + mark "package and upload issue41 artifacts" + RUN_ROOT="$RUN_ROOT" REPO_DIR="$REPO_DIR" bash scripts/package_issue41_hf_upload.sh \ + > "$RUN_ROOT/logs/package_issue41_hf_upload.log" 2>&1 +fi +mark "issue41 done" diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/package_issue41_hf_upload.sh b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/package_issue41_hf_upload.sh new file mode 100644 index 0000000000000000000000000000000000000000..db638db10c5c7166781f02a601dee4aceede5cf3 --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/package_issue41_hf_upload.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +# Package and upload issue #41 substrate-only artifacts. +set -euo pipefail + +RUN_ROOT="${RUN_ROOT:-/root/runs/issue41_mined_substrate_only}" +REPO_DIR="${REPO_DIR:-/root/work/circuit-shotting}" +STAMP="$(date -u +%Y%m%dT%H%M%SZ)" +UPLOAD_PREFIX="${UPLOAD_PREFIX:-issue41_mined_substrate_only_$STAMP}" +SYNTH_HF_REPO="${SYNTH_HF_REPO:-TokenBender/synth-data-en-pt-circuit}" +CIRCUIT_HF_REPO="${CIRCUIT_HF_REPO:-TokenBender/circuit-discovery}" +UPLOAD_DIR="$RUN_ROOT/package/$UPLOAD_PREFIX" + +rm -rf "$UPLOAD_DIR" +mkdir -p "$UPLOAD_DIR"/{spec,scripts,eval,dumps,xcomet,summaries,logs,manifests} + +copy_if_present() { + local src="$1" + local dst="$2" + if [[ -e "$src" ]]; then + mkdir -p "$(dirname "$dst")" + cp -a "$src" "$dst" + fi +} + +copy_if_present "$REPO_DIR/configs/issue41_mined_substrate_only.json" "$UPLOAD_DIR/spec/issue41_mined_substrate_only.json" + +for path in \ + actdelta_mlp_common.py \ + evaluate_mlp_nuke_translation.py \ + evaluate_actdelta_lora_translation.py \ + summarize_issue41_substrate_only.py \ + issue41_substrate_only_runner.sh \ + score_xcomet_sharded.py \ + score_xcomet_service_client.py \ + xcomet_service.py \ + scripts/package_issue41_hf_upload.sh; do + copy_if_present "$REPO_DIR/$path" "$UPLOAD_DIR/scripts/$(basename "$path")" +done + +cp -a "$RUN_ROOT/eval"/* "$UPLOAD_DIR/eval/" 2>/dev/null || true +cp -a "$RUN_ROOT/xcomet"/* "$UPLOAD_DIR/xcomet/" 2>/dev/null || true +cp -a "$RUN_ROOT/summaries"/* "$UPLOAD_DIR/summaries/" 2>/dev/null || true +cp -a "$RUN_ROOT/logs"/* "$UPLOAD_DIR/logs/" 2>/dev/null || true + +find "$RUN_ROOT/dumps" -maxdepth 3 -type f -name '*.jsonl' -print0 2>/dev/null \ + | while IFS= read -r -d '' file; do + rel="${file#$RUN_ROOT/dumps/}" + copy_if_present "$file" "$UPLOAD_DIR/dumps/$rel" + done + +find "$UPLOAD_DIR" -type f -print0 | sort -z | xargs -0 sha256sum > "$UPLOAD_DIR/manifests/SHA256SUMS" +python3 - "$UPLOAD_DIR" "$RUN_ROOT" "$UPLOAD_PREFIX" <<'PY' +import json, sys +from pathlib import Path +upload = Path(sys.argv[1]) +run_root = Path(sys.argv[2]) +prefix = sys.argv[3] +files = [p for p in upload.rglob("*") if p.is_file()] +manifest = { + "upload_prefix": prefix, + "run_root": str(run_root), + "file_count": len(files), + "bytes": sum(p.stat().st_size for p in files), + "source_issue39_artifacts": "TokenBender/circuit-discovery:circuit-shotting/artifacts/actdelta_lora_mlp_mvc/issue39_actdelta_lora_mlp_mvc_20260518T011201Z", + "weights_policy": "Includes generated hypotheses, scores, summaries, scripts, and logs. Excludes upstream HY-MT/XCOMET model weights, HF caches, API keys, and service tokens.", +} +(upload / "manifests" / "manifest.json").write_text(json.dumps(manifest, indent=2) + "\n") +(upload / "README.md").write_text( + "# Issue 41 Mined MLP Substrate-Only Artifacts\n\n" + "This package contains native and ActDelta repaired substrate-only EN->PT eval outputs " + "for the issue 39 mined MLP final mix.\n\n" + "Upstream HY-MT and XCOMET model weights are not included.\n" +) +PY + +hf upload "$SYNTH_HF_REPO" "$UPLOAD_DIR" "$UPLOAD_PREFIX" --repo-type dataset +hf upload "$CIRCUIT_HF_REPO" "$UPLOAD_DIR" "circuit-shotting/artifacts/mined_substrate_only/$UPLOAD_PREFIX" --repo-type dataset + +echo "$UPLOAD_PREFIX" diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/score_xcomet_service_client.py b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/score_xcomet_service_client.py new file mode 100644 index 0000000000000000000000000000000000000000..0bc097bfe07269f149c7e1fb61ceea6c2602516b --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/score_xcomet_service_client.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python3 +"""Score a hypothesis JSONL through the XCOMET HTTP service.""" + +from __future__ import annotations + +import argparse +import json +import os +import urllib.error +import urllib.request +from pathlib import Path + + +def parse_args() -> argparse.Namespace: + p = argparse.ArgumentParser(description=__doc__) + p.add_argument("--base-url", default=os.environ.get("XCOMET_SERVICE_BASE_URL", "http://127.0.0.1:20000")) + p.add_argument("--token", default=os.environ.get("XCOMET_SERVICE_TOKEN")) + p.add_argument("--token-file", default=os.environ.get("XCOMET_SERVICE_TOKEN_FILE")) + p.add_argument("--hyps-jsonl", required=True) + p.add_argument("--out-json", required=True) + p.add_argument("--out-dir", default=None) + p.add_argument("--request-id", default=None) + p.add_argument("--system-name", default=None) + p.add_argument("--batch-size", type=int, default=8) + p.add_argument("--chunk-size", type=int, default=128) + p.add_argument("--timeout-s", type=float, default=3600) + p.add_argument("--return-rows", action=argparse.BooleanOptionalAction, default=False) + return p.parse_args() + + +def resolve_token(args: argparse.Namespace) -> str: + if args.token: + return args.token + if args.token_file: + return Path(args.token_file).read_text().strip() + raise SystemExit("set --token, --token-file, XCOMET_SERVICE_TOKEN, or XCOMET_SERVICE_TOKEN_FILE") + + +def request_json(method: str, url: str, token: str, payload: dict | None, + timeout: float) -> dict: + body = None if payload is None else json.dumps(payload).encode("utf-8") + req = urllib.request.Request(url, data=body, method=method) + req.add_header("Authorization", f"Bearer {token}") + if body is not None: + req.add_header("Content-Type", "application/json") + try: + with urllib.request.urlopen(req, timeout=timeout) as resp: + return json.loads(resp.read()) + except urllib.error.HTTPError as exc: + text = exc.read().decode("utf-8", errors="replace") + raise SystemExit(f"{url} failed {exc.code}: {text}") from exc + + +def main() -> None: + args = parse_args() + token = resolve_token(args) + base = args.base_url.rstrip("/") + health = request_json("GET", f"{base}/health", token, None, timeout=30) + payload = { + "hyps_jsonl": args.hyps_jsonl, + "out_dir": args.out_dir, + "request_id": args.request_id, + "system_name": args.system_name or Path(args.hyps_jsonl).stem, + "batch_size": args.batch_size, + "chunk_size": args.chunk_size, + "timeout_s": args.timeout_s, + "return_rows": args.return_rows, + } + payload = {k: v for k, v in payload.items() if v is not None} + result = request_json("POST", f"{base}/score-dataset", token, payload, timeout=args.timeout_s + 60) + out_path = Path(args.out_json) + out_path.parent.mkdir(parents=True, exist_ok=True) + with out_path.open("w") as f: + json.dump({ + "health": { + "model_loaded": health.get("model_loaded"), + "comet_model": health.get("comet_model"), + "cuda": health.get("cuda"), + }, + **result, + }, f, indent=2, ensure_ascii=False) + print(json.dumps({ + "out_json": str(out_path), + "model_loaded": health.get("model_loaded"), + "summary": result.get("summary"), + "outputs": result.get("outputs"), + }, indent=2, ensure_ascii=False), flush=True) + + +if __name__ == "__main__": + main() diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/score_xcomet_sharded.py b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/score_xcomet_sharded.py new file mode 100644 index 0000000000000000000000000000000000000000..311409c656eae2cd7657e8a9896f29c35a63ffe3 --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/score_xcomet_sharded.py @@ -0,0 +1,194 @@ +#!/usr/bin/env python3 +"""Score one hypothesis file by sharding it across all XCOMET services.""" + +from __future__ import annotations + +import argparse +from concurrent.futures import ThreadPoolExecutor, as_completed +import json +import statistics +import time +import urllib.error +import urllib.request +from pathlib import Path +from typing import Any + + +def parse_args() -> argparse.Namespace: + p = argparse.ArgumentParser(description=__doc__) + p.add_argument("--hyps-jsonl", required=True) + p.add_argument("--out-json", required=True) + p.add_argument("--out-jsonl", required=True) + p.add_argument("--shard-dir", required=True) + p.add_argument("--service", action="append", required=True, + help="Service spec idx,base_url,token_file. Repeat once per GPU.") + p.add_argument("--request-id", default=None) + p.add_argument("--system-name", default=None) + p.add_argument("--batch-size", type=int, default=1) + p.add_argument("--chunk-size", type=int, default=16) + p.add_argument("--timeout-s", type=float, default=7200) + p.add_argument("--threshold", type=float, default=0.99) + return p.parse_args() + + +def load_jsonl(path: Path) -> list[dict[str, Any]]: + rows = [] + with path.open() as f: + for idx, line in enumerate(f): + if not line.strip(): + continue + row = json.loads(line) + row.setdefault("id", idx) + rows.append(row) + return rows + + +def write_jsonl(path: Path, rows: list[dict[str, Any]]) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + with path.open("w") as f: + for row in rows: + f.write(json.dumps(row, ensure_ascii=False) + "\n") + + +def parse_service(spec: str) -> dict[str, Any]: + parts = spec.split(",", 2) + if len(parts) != 3: + raise ValueError(f"bad --service {spec!r}; expected idx,base_url,token_file") + idx, base_url, token_file = parts + return { + "idx": int(idx), + "base_url": base_url.rstrip("/"), + "token_file": token_file, + "token": Path(token_file).read_text().strip(), + } + + +def request_json(method: str, url: str, token: str, payload: dict[str, Any] | None, + timeout: float) -> dict[str, Any]: + body = None if payload is None else json.dumps(payload).encode("utf-8") + req = urllib.request.Request(url, data=body, method=method) + req.add_header("Authorization", f"Bearer {token}") + if body is not None: + req.add_header("Content-Type", "application/json") + try: + with urllib.request.urlopen(req, timeout=timeout) as resp: + return json.loads(resp.read()) + except urllib.error.HTTPError as exc: + text = exc.read().decode("utf-8", errors="replace") + raise RuntimeError(f"{url} failed {exc.code}: {text}") from exc + + +def score_shard(service: dict[str, Any], shard_path: Path, *, request_id: str, + system_name: str, batch_size: int, chunk_size: int, + timeout_s: float) -> dict[str, Any]: + base = service["base_url"] + token = service["token"] + health = request_json("GET", f"{base}/health", token, None, timeout=30) + payload = { + "hyps_jsonl": str(shard_path), + "request_id": request_id, + "system_name": system_name, + "batch_size": batch_size, + "chunk_size": chunk_size, + "timeout_s": timeout_s, + "return_rows": False, + } + result = request_json("POST", f"{base}/score-dataset", token, payload, timeout=timeout_s + 60) + return { + "service": { + "idx": service["idx"], + "base_url": base, + "health": { + "model_loaded": health.get("model_loaded"), + "comet_model": health.get("comet_model"), + "cuda": health.get("cuda"), + }, + }, + "shard_path": str(shard_path), + **result, + } + + +def main() -> None: + args = parse_args() + services = [parse_service(spec) for spec in args.service] + if not services: + raise ValueError("at least one --service is required") + rows = load_jsonl(Path(args.hyps_jsonl)) + if not rows: + raise ValueError(f"no rows in {args.hyps_jsonl}") + + shard_dir = Path(args.shard_dir) + shard_dir.mkdir(parents=True, exist_ok=True) + request_root = args.request_id or Path(args.hyps_jsonl).stem + system_name = args.system_name or Path(args.hyps_jsonl).stem + + shard_paths: list[Path] = [] + for shard_idx, service in enumerate(services): + shard_rows = rows[shard_idx::len(services)] + shard_path = shard_dir / f"shard_{shard_idx:03d}.jsonl" + write_jsonl(shard_path, shard_rows) + shard_paths.append(shard_path) + + t0 = time.time() + shard_results: list[dict[str, Any]] = [] + with ThreadPoolExecutor(max_workers=len(services)) as executor: + futures = [] + for shard_idx, (service, shard_path) in enumerate(zip(services, shard_paths)): + futures.append(executor.submit( + score_shard, + service, + shard_path, + request_id=f"{request_root}_shard{shard_idx:03d}", + system_name=f"{system_name}_shard{shard_idx:03d}", + batch_size=args.batch_size, + chunk_size=args.chunk_size, + timeout_s=args.timeout_s, + )) + for future in as_completed(futures): + shard_results.append(future.result()) + + scored_rows: list[dict[str, Any]] = [] + for result in shard_results: + out_jsonl = result.get("outputs", {}).get("out_jsonl") + if not out_jsonl: + raise ValueError(f"shard result missing outputs.out_jsonl: {result}") + for row in load_jsonl(Path(out_jsonl)): + row["system"] = system_name + scored_rows.append(row) + scored_rows.sort(key=lambda row: int(row.get("row_id", row.get("id", 0)))) + + scores = [float(row["score"]) for row in scored_rows] + out_jsonl = Path(args.out_jsonl) + write_jsonl(out_jsonl, scored_rows) + summary = { + "source_path": args.hyps_jsonl, + "comet_model": shard_results[0].get("summary", {}).get("comet_model"), + "checkpoint_path": shard_results[0].get("summary", {}).get("checkpoint_path"), + "n": len(scored_rows), + "threshold": args.threshold, + "system_score": statistics.fmean(scores), + "passed": sum(1 for score in scores if score >= args.threshold), + "elapsed_seconds": time.time() - t0, + "batch_size": args.batch_size, + "chunk_size": args.chunk_size, + "shard_count": len(services), + "throughput_seg_per_s": len(scored_rows) / max(time.time() - t0, 1e-9), + } + payload = { + "health": [result["service"] for result in sorted(shard_results, key=lambda row: row["service"]["idx"])], + "summary": summary, + "outputs": { + "out_jsonl": str(out_jsonl), + "shard_dir": str(shard_dir), + }, + "shards": sorted(shard_results, key=lambda row: row["service"]["idx"]), + } + out_json = Path(args.out_json) + out_json.parent.mkdir(parents=True, exist_ok=True) + out_json.write_text(json.dumps(payload, indent=2, ensure_ascii=False) + "\n") + print(json.dumps({"out_json": str(out_json), "summary": summary}, indent=2), flush=True) + + +if __name__ == "__main__": + main() diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/summarize_issue41_substrate_only.py b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/summarize_issue41_substrate_only.py new file mode 100644 index 0000000000000000000000000000000000000000..6834cbaa3c70f9a57f07e36a2fe1b0c0c2969304 --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/summarize_issue41_substrate_only.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python3 +"""Summarize issue #41 substrate-only sufficiency evals.""" + +from __future__ import annotations + +import argparse +import json +from pathlib import Path + + +def parse_args() -> argparse.Namespace: + p = argparse.ArgumentParser(description=__doc__) + p.add_argument("--run-root", required=True) + p.add_argument("--baseline-xcomet", type=float, default=0.9287162019683438) + p.add_argument("--out-json", required=True) + p.add_argument("--out-md", required=True) + return p.parse_args() + + +def maybe_json(path: Path): + if path.exists(): + return json.load(open(path)) + return None + + +def xcomet_score(path: Path): + payload = maybe_json(path) + if not payload: + return None + return payload.get("summary", {}).get("system_score") + + +def main() -> None: + args = parse_args() + root = Path(args.run_root) + rows = [] + + native_eval = maybe_json(root / "eval" / "native_substrate_only.json") + native_result = (native_eval or {}).get("results", {}).get("native_mined_substrate_only") + native_xcomet = xcomet_score(root / "xcomet" / "native_mined_substrate_only.json") + if native_result: + rows.append({ + "system": "native_mined_substrate_only", + "rank": None, + "channels": native_result.get("channels"), + "params": None, + "scores": native_result.get("scores", {}), + "xcomet": native_xcomet, + "recovery": native_xcomet / args.baseline_xcomet if native_xcomet is not None else None, + "method": "native selected MLP channels only; all other MLP channels zeroed", + }) + + actdelta_eval = maybe_json(root / "eval" / "actdelta_rank256_substrate_only.json") + actdelta_xcomet = xcomet_score(root / "xcomet" / "actdelta_rank256_substrate_only.json") + if actdelta_eval: + rows.append({ + "system": "actdelta_rank256_substrate_only", + "rank": actdelta_eval.get("rank"), + "channels": actdelta_eval.get("channels"), + "params": actdelta_eval.get("parameter_count"), + "scores": actdelta_eval.get("scores", {}), + "xcomet": actdelta_xcomet, + "recovery": actdelta_xcomet / args.baseline_xcomet if actdelta_xcomet is not None else None, + "method": "rank-256 ActDelta reconstruction of selected channels only; all other MLP channels zeroed", + }) + + summary = { + "run_root": str(root), + "baseline_xcomet": args.baseline_xcomet, + "systems": rows, + } + out_json = Path(args.out_json) + out_md = Path(args.out_md) + out_json.parent.mkdir(parents=True, exist_ok=True) + out_md.parent.mkdir(parents=True, exist_ok=True) + out_json.write_text(json.dumps(summary, indent=2, ensure_ascii=False) + "\n") + + lines = [ + "# Issue 41 Mined MLP Substrate-Only Summary", + "", + f"- Baseline XCOMET: `{args.baseline_xcomet}`", + "", + "| system | rank | channels | params | chrF++ | BLEU | XCOMET | recovery |", + "|---|---:|---:|---:|---:|---:|---:|---:|", + ] + for row in rows: + scores = row.get("scores") or {} + rank = "-" if row.get("rank") is None else row["rank"] + params = "-" if row.get("params") is None else row["params"] + lines.append( + f"| `{row['system']}` | `{rank}` | `{row.get('channels')}` | `{params}` | " + f"`{scores.get('chrFpp')}` | `{scores.get('BLEU')}` | " + f"`{row.get('xcomet')}` | `{row.get('recovery')}` |" + ) + out_md.write_text("\n".join(lines) + "\n") + print(json.dumps({"out_json": str(out_json), "out_md": str(out_md)}, indent=2), flush=True) + + +if __name__ == "__main__": + main() diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/xcomet_service.py b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/xcomet_service.py new file mode 100644 index 0000000000000000000000000000000000000000..357cd14642bde8f3955c38933a3acef0447e653a --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/scripts/xcomet_service.py @@ -0,0 +1,560 @@ +#!/usr/bin/env python3 +"""Long-running HTTP service for XCOMET/COMET scoring and dataset export.""" + +from __future__ import annotations + +import argparse +from dataclasses import dataclass +import json +import os +import queue +import statistics +import threading +import time +import uuid +from http import HTTPStatus +from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer +from pathlib import Path +from types import SimpleNamespace +from typing import Any + +import torch + +from build_xcomet_ft_dataset import ( + build_preferences, + build_repairs, + build_sft, + load_jsonl, + normalize_pool, + score_distribution, + write_jsonl, +) +from score_xcomet_pool import prediction_extras, resolve_checkpoint + + +def parse_args() -> argparse.Namespace: + p = argparse.ArgumentParser(description=__doc__) + p.add_argument("--host", default="0.0.0.0") + p.add_argument("--port", type=int, default=20000) + p.add_argument("--comet-model", default=os.environ.get("COMET_MODEL", "Unbabel/XCOMET-XXL")) + p.add_argument("--checkpoint-path", default=os.environ.get("XCOMET_CKPT_PATH")) + p.add_argument("--run-root", default=os.environ.get("RUN_ROOT", "/root/runs/xcomet_service")) + p.add_argument("--default-batch-size", type=int, default=int(os.environ.get("XCOMET_BATCH", "4"))) + p.add_argument("--default-chunk-size", type=int, default=int(os.environ.get("XCOMET_CHUNK", "32"))) + p.add_argument("--max-worker-batch-size", type=int, default=int(os.environ.get("XCOMET_MAX_WORKER_BATCH", os.environ.get("XCOMET_BATCH", "4")))) + p.add_argument("--max-batch-rows", type=int, default=int(os.environ.get("XCOMET_MAX_BATCH_ROWS", os.environ.get("XCOMET_CHUNK", "32")))) + p.add_argument("--max-batch-wait-ms", type=int, default=int(os.environ.get("XCOMET_MAX_BATCH_WAIT_MS", "100"))) + p.add_argument("--max-queue-rows", type=int, default=int(os.environ.get("XCOMET_MAX_QUEUE_ROWS", "4096"))) + p.add_argument("--queue-timeout-s", type=float, default=float(os.environ.get("XCOMET_QUEUE_TIMEOUT_S", "1800"))) + p.add_argument("--float32-matmul-precision", choices=["highest", "high", "medium"], default=os.environ.get("XCOMET_FLOAT32_MATMUL_PRECISION", "high")) + p.add_argument("--threshold", type=float, default=float(os.environ.get("XCOMET_THRESHOLD", "0.99"))) + p.add_argument("--auth-token", default=os.environ.get("XCOMET_SERVICE_TOKEN")) + p.add_argument("--load-on-start", action="store_true") + return p.parse_args() + + +@dataclass(frozen=True) +class ScoreResult: + score: float + extra: dict[str, Any] + + +@dataclass(frozen=True) +class ScoreUnit: + job: "ScoreJob" + index: int + data: dict[str, Any] + batch_size: int + enqueued_at: float + + +class ScoreJob: + def __init__(self, size: int): + self.results: list[ScoreResult | None] = [None] * size + self.remaining = size + self.error: BaseException | None = None + self.event = threading.Event() + self.lock = threading.Lock() + + def record(self, index: int, result: ScoreResult) -> None: + with self.lock: + if self.error is not None: + return + self.results[index] = result + self.remaining -= 1 + if self.remaining == 0: + self.event.set() + + def fail(self, exc: BaseException) -> None: + with self.lock: + if self.error is None: + self.error = exc + self.event.set() + + +class ScoringBatcher: + """Single GPU worker with dynamic row batching across HTTP callers.""" + + def __init__(self, state: "ServiceState"): + self.state = state + self.work: queue.Queue[ScoreUnit] = queue.Queue(maxsize=state.args.max_queue_rows) + self.max_rows = max(1, state.args.max_batch_rows) + self.max_worker_batch_size = max(1, state.args.max_worker_batch_size) + self.max_wait_seconds = max(0.0, state.args.max_batch_wait_ms / 1000.0) + self.stats_lock = threading.Lock() + self.active_batch_rows = 0 + self.completed_batches = 0 + self.completed_rows = 0 + self.failed_batches = 0 + self.last_batch_rows = 0 + self.last_batch_seconds: float | None = None + self.last_batch_started_at: float | None = None + self.last_error: str | None = None + self.worker = threading.Thread(target=self._worker_loop, name="xcomet-gpu-worker", daemon=True) + self.worker.start() + + def status(self) -> dict[str, Any]: + with self.stats_lock: + return { + "pending_rows": self.work.qsize(), + "active_batch_rows": self.active_batch_rows, + "completed_batches": self.completed_batches, + "completed_rows": self.completed_rows, + "failed_batches": self.failed_batches, + "last_batch_rows": self.last_batch_rows, + "last_batch_seconds": self.last_batch_seconds, + "last_batch_started_at": self.last_batch_started_at, + "last_error": self.last_error, + "max_batch_rows": self.max_rows, + "max_worker_batch_size": self.max_worker_batch_size, + "max_batch_wait_ms": int(self.max_wait_seconds * 1000), + "max_queue_rows": self.work.maxsize, + } + + def score(self, data: list[dict[str, Any]], batch_size: int, timeout_s: float | None) -> list[ScoreResult]: + job = ScoreJob(len(data)) + deadline = None if timeout_s is None else time.time() + timeout_s + for index, item in enumerate(data): + remaining = None if deadline is None else max(0.0, deadline - time.time()) + try: + self.work.put( + ScoreUnit(job=job, index=index, data=item, batch_size=batch_size, enqueued_at=time.time()), + timeout=remaining, + ) + except queue.Full as exc: + job.fail(TimeoutError("timed out while queueing rows for scoring")) + raise TimeoutError("timed out while queueing rows for scoring") from exc + + wait_timeout = None if deadline is None else max(0.0, deadline - time.time()) + if not job.event.wait(wait_timeout): + job.fail(TimeoutError("timed out while waiting for scoring")) + raise TimeoutError("timed out while waiting for scoring") + if job.error is not None: + raise job.error + results = [result for result in job.results if result is not None] + if len(results) != len(data): + raise RuntimeError("scoring worker returned an incomplete result set") + return results + + def _worker_loop(self) -> None: + while True: + first = self.work.get() + units = [first] + deadline = time.time() + self.max_wait_seconds + while len(units) < self.max_rows: + timeout = max(0.0, deadline - time.time()) + if timeout == 0.0: + break + try: + units.append(self.work.get(timeout=timeout)) + except queue.Empty: + break + self._predict_units(units) + for _ in units: + self.work.task_done() + + def _predict_units(self, units: list[ScoreUnit]) -> None: + started = time.time() + with self.stats_lock: + self.active_batch_rows = len(units) + self.last_batch_started_at = started + try: + self.state.load_model() + batch_size = min(max(unit.batch_size for unit in units), self.max_worker_batch_size) + preds = self.state.model.predict( + [unit.data for unit in units], + batch_size=batch_size, + gpus=1, + progress_bar=False, + ) + scores = [float(s) for s in preds["scores"]] + extras = prediction_extras(preds, 0, len(units)) + for unit, score, extra in zip(units, scores, extras, strict=True): + unit.job.record(unit.index, ScoreResult(score=score, extra=extra or {})) + elapsed = time.time() - started + with self.stats_lock: + self.completed_batches += 1 + self.completed_rows += len(units) + self.last_batch_rows = len(units) + self.last_batch_seconds = elapsed + self.last_error = None + except Exception as exc: # noqa: BLE001 - return scoring failures to callers + with self.stats_lock: + self.failed_batches += 1 + self.last_error = f"{type(exc).__name__}: {exc}" + for unit in units: + unit.job.fail(exc) + finally: + with self.stats_lock: + self.active_batch_rows = 0 + if torch.cuda.is_available(): + torch.cuda.empty_cache() + + +class ServiceState: + def __init__(self, args: argparse.Namespace): + self.args = args + self.run_root = Path(args.run_root) + self.run_root.mkdir(parents=True, exist_ok=True) + self.model = None + self.checkpoint_path: str | None = None + self.loaded_at: float | None = None + self.load_error: str | None = None + self.load_lock = threading.Lock() + self.scoring_batcher = ScoringBatcher(self) + + def load_model(self) -> dict[str, Any]: + with self.load_lock: + if self.model is not None: + return self.status() + try: + from comet import load_from_checkpoint + + ckpt = resolve_checkpoint(self.args.comet_model, self.args.checkpoint_path) + model = load_from_checkpoint(ckpt) + self.model = model + self.checkpoint_path = ckpt + self.loaded_at = time.time() + self.load_error = None + except Exception as exc: # noqa: BLE001 - report service-load failures + self.load_error = f"{type(exc).__name__}: {exc}" + raise + return self.status() + + def status(self) -> dict[str, Any]: + cuda = { + "available": torch.cuda.is_available(), + "device_count": torch.cuda.device_count(), + } + if torch.cuda.is_available(): + cuda["device_name"] = torch.cuda.get_device_name(0) + cuda["memory_allocated"] = torch.cuda.memory_allocated(0) + cuda["memory_reserved"] = torch.cuda.memory_reserved(0) + return { + "ok": self.load_error is None, + "model_loaded": self.model is not None, + "comet_model": self.args.comet_model, + "checkpoint_path": self.checkpoint_path, + "loaded_at": self.loaded_at, + "run_root": str(self.run_root), + "float32_matmul_precision": self.args.float32_matmul_precision, + "cuda": cuda, + "load_error": self.load_error, + "queue": self.scoring_batcher.status(), + } + + +def rows_from_request(payload: dict[str, Any]) -> tuple[list[dict[str, Any]], str]: + max_rows = payload.get("max_rows") + if payload.get("rows") is not None: + rows = list(payload["rows"]) + if max_rows is not None: + rows = rows[: int(max_rows)] + return rows, payload.get("source_path", "request_rows") + if payload.get("hyps_jsonl"): + path = Path(payload["hyps_jsonl"]) + rows = load_jsonl(path) + if max_rows is not None: + rows = rows[: int(max_rows)] + return rows, str(path) + raise ValueError("request needs either rows or hyps_jsonl") + + +def score_payload(state: ServiceState, payload: dict[str, Any]) -> tuple[list[dict[str, Any]], dict[str, Any]]: + state.load_model() + rows, source_path = rows_from_request(payload) + + src_field = payload.get("src_field", "en") + ref_field = payload.get("ref_field", "pt") + hyp_field = payload.get("hyp_field", "model_hyp") + id_field = payload.get("id_field", "id") + batch_size = int(payload.get("batch_size", state.args.default_batch_size)) + chunk_size = int(payload.get("chunk_size", state.args.default_chunk_size)) + timeout_s = float(payload.get("timeout_s", state.args.queue_timeout_s)) + threshold = float(payload.get("threshold", state.args.threshold)) + system_name = payload.get("system_name") or Path(source_path).stem + + data = [] + valid_rows = [] + for row in rows: + src = row.get(src_field) + hyp = row.get(hyp_field) + ref = row.get(ref_field) + if src is None or hyp is None: + continue + item = {"src": src, "mt": hyp} + if ref is not None: + item["ref"] = ref + data.append(item) + valid_rows.append(row) + if not data: + raise ValueError("no scoreable rows found") + + t0 = time.time() + scored_rows: list[dict[str, Any]] = [] + seg_scores: list[float] = [] + results = state.scoring_batcher.score(data, batch_size=batch_size, timeout_s=timeout_s) + for i, result in enumerate(results): + src_row = valid_rows[i] + scored = { + "row_id": src_row.get(id_field, i), + "source_path": source_path, + "system": system_name, + "metric": state.args.comet_model, + "score": result.score, + "src": src_row[src_field], + "ref": src_row.get(ref_field), + "mt": src_row[hyp_field], + "category": src_row.get("category"), + "tag": src_row.get("tag"), + "metadata": { + k: v for k, v in src_row.items() + if k not in {src_field, ref_field, hyp_field} + }, + } + if result.extra: + scored["metric_metadata"] = result.extra + scored_rows.append(scored) + seg_scores.append(result.score) + + summary = { + "source_path": source_path, + "comet_model": state.args.comet_model, + "checkpoint_path": state.checkpoint_path, + "n": len(scored_rows), + "threshold": threshold, + "system_score": statistics.fmean(seg_scores), + "passed": sum(1 for s in seg_scores if s >= threshold), + "elapsed_seconds": time.time() - t0, + "batch_size": batch_size, + "chunk_size": chunk_size, + "max_worker_batch_size": state.scoring_batcher.max_worker_batch_size, + "max_batch_rows": state.scoring_batcher.max_rows, + "max_batch_wait_ms": int(state.scoring_batcher.max_wait_seconds * 1000), + "throughput_seg_per_s": len(scored_rows) / max(time.time() - t0, 1e-9), + } + return scored_rows, summary + + +def write_score_outputs(payload: dict[str, Any], rows: list[dict[str, Any]], summary: dict[str, Any]) -> dict[str, Any]: + out: dict[str, Any] = {} + out_jsonl = payload.get("out_jsonl") + if out_jsonl: + path = Path(out_jsonl) + path.parent.mkdir(parents=True, exist_ok=True) + write_jsonl(path, rows) + out["out_jsonl"] = str(path) + + summary_json = payload.get("summary_json") + if summary_json: + path = Path(summary_json) + path.parent.mkdir(parents=True, exist_ok=True) + with path.open("w") as f: + json.dump(summary, f, indent=2, ensure_ascii=False) + out["summary_json"] = str(path) + return out + + +def build_dataset_payload(payload: dict[str, Any]) -> dict[str, Any]: + if payload.get("scored_rows") is not None: + scored_rows = normalize_pool(list(payload["scored_rows"])) + source = payload.get("source", "request_scored_rows") + elif payload.get("scored_jsonl"): + source_path = Path(payload["scored_jsonl"]) + scored_rows = normalize_pool(load_jsonl(source_path)) + source = str(source_path) + else: + raise ValueError("request needs either scored_rows or scored_jsonl") + if not scored_rows: + raise ValueError("no valid scored rows") + + out_dir = Path(payload["out_dir"]) + out_dir.mkdir(parents=True, exist_ok=True) + args = SimpleNamespace( + target_language=payload.get("target_language", "Portuguese"), + sft_min_score=float(payload.get("sft_min_score", 0.85)), + preference_min_gap=float(payload.get("preference_min_gap", 0.05)), + repair_max_score=float(payload.get("repair_max_score", 0.80)), + max_pairs_per_source=int(payload.get("max_pairs_per_source", 3)), + ) + + rows_by_source: dict[str, list[dict[str, Any]]] = {} + for row in scored_rows: + rows_by_source.setdefault(row["src"], []).append(row) + + sft_rows, sft_rejects = build_sft(rows_by_source, args) + pref_rows, pref_rejects = build_preferences(rows_by_source, args) + repair_rows, repair_rejects = build_repairs(scored_rows, args) + + write_jsonl(out_dir / "scored_pool.jsonl", scored_rows) + write_jsonl(out_dir / "sft.jsonl", sft_rows) + write_jsonl(out_dir / "preferences.jsonl", pref_rows) + write_jsonl(out_dir / "repair_triples.jsonl", repair_rows) + + from collections import Counter + + manifest = { + "source": source, + "target_language": args.target_language, + "thresholds": { + "sft_min_score": args.sft_min_score, + "preference_min_gap": args.preference_min_gap, + "repair_max_score": args.repair_max_score, + "max_pairs_per_source": args.max_pairs_per_source, + }, + "counts": { + "scored_pool": len(scored_rows), + "unique_sources": len(rows_by_source), + "sft": len(sft_rows), + "preferences": len(pref_rows), + "repair_triples": len(repair_rows), + }, + "splits": dict(Counter(row["split"] for row in scored_rows)), + "systems": dict(Counter(row.get("system", "?") for row in scored_rows)), + "categories": dict(Counter(row.get("category", "?") for row in scored_rows)), + "score_distribution": score_distribution(scored_rows), + "rejections": { + "sft": dict(sft_rejects), + "preferences": dict(pref_rejects), + "repair_triples": dict(repair_rejects), + }, + "artifacts": { + "scored_pool": str(out_dir / "scored_pool.jsonl"), + "sft": str(out_dir / "sft.jsonl"), + "preferences": str(out_dir / "preferences.jsonl"), + "repair_triples": str(out_dir / "repair_triples.jsonl"), + }, + } + with (out_dir / "curriculum_manifest.json").open("w") as f: + json.dump(manifest, f, indent=2, ensure_ascii=False) + return manifest + + +def make_handler(state: ServiceState): + class Handler(BaseHTTPRequestHandler): + server_version = "XCOMETService/0.1" + + def log_message(self, fmt: str, *args: Any) -> None: + print(f"[{self.log_date_time_string()}] {self.address_string()} {fmt % args}", flush=True) + + def authenticated(self) -> bool: + token = state.args.auth_token + if not token: + return True + auth = self.headers.get("Authorization", "") + header_token = self.headers.get("X-XCOMET-Token") + return auth == f"Bearer {token}" or header_token == token + + def read_json(self) -> dict[str, Any]: + n = int(self.headers.get("Content-Length", "0")) + if n <= 0: + return {} + return json.loads(self.rfile.read(n)) + + def send_json(self, status: HTTPStatus, payload: dict[str, Any]) -> None: + body = json.dumps(payload, ensure_ascii=False).encode("utf-8") + self.send_response(status) + self.send_header("Content-Type", "application/json; charset=utf-8") + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + def do_GET(self) -> None: + if self.path in {"/", "/health"}: + self.send_json(HTTPStatus.OK, state.status() | { + "endpoints": ["/health", "/load", "/score", "/dataset", "/score-dataset"], + }) + return + self.send_json(HTTPStatus.NOT_FOUND, {"error": "not found"}) + + def do_POST(self) -> None: + if not self.authenticated(): + self.send_json(HTTPStatus.UNAUTHORIZED, {"error": "unauthorized"}) + return + try: + payload = self.read_json() + if self.path == "/load": + self.send_json(HTTPStatus.OK, state.load_model()) + return + if self.path == "/score": + rows, summary = score_payload(state, payload) + outputs = write_score_outputs(payload, rows, summary) + response = {"summary": summary, "outputs": outputs} + if payload.get("return_rows", True): + response["rows"] = rows + self.send_json(HTTPStatus.OK, response) + return + if self.path == "/dataset": + self.send_json(HTTPStatus.OK, {"manifest": build_dataset_payload(payload)}) + return + if self.path == "/score-dataset": + request_id = payload.get("request_id") or uuid.uuid4().hex[:12] + root = state.run_root / request_id + payload.setdefault("out_jsonl", str(root / "scored_pool.jsonl")) + payload.setdefault("summary_json", str(root / "scored_pool.summary.json")) + payload.setdefault("out_dir", str(root / "dataset")) + rows, summary = score_payload(state, payload) + outputs = write_score_outputs(payload, rows, summary) + manifest = build_dataset_payload({ + **payload, + "scored_rows": rows, + "source": outputs.get("out_jsonl", "inline_scored_rows"), + }) + self.send_json(HTTPStatus.OK, { + "summary": summary, + "outputs": outputs, + "manifest": manifest, + }) + return + self.send_json(HTTPStatus.NOT_FOUND, {"error": "not found"}) + except Exception as exc: # noqa: BLE001 - return JSON errors to callers + self.send_json(HTTPStatus.INTERNAL_SERVER_ERROR, { + "error": type(exc).__name__, + "message": str(exc), + }) + + return Handler + + +def main() -> None: + args = parse_args() + if torch.cuda.is_available(): + torch.set_float32_matmul_precision(args.float32_matmul_precision) + state = ServiceState(args) + if args.load_on_start: + state.load_model() + server = ThreadingHTTPServer((args.host, args.port), make_handler(state)) + print(json.dumps({ + "event": "xcomet_service_start", + "host": args.host, + "port": args.port, + "comet_model": args.comet_model, + "run_root": args.run_root, + "auth_enabled": bool(args.auth_token), + "load_on_start": args.load_on_start, + }), flush=True) + server.serve_forever() + + +if __name__ == "__main__": + main() diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/spec/issue41_mined_substrate_only.json b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/spec/issue41_mined_substrate_only.json new file mode 100644 index 0000000000000000000000000000000000000000..de5a4e9d6de644103fa46ca1524eef50c8edf2c9 --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/spec/issue41_mined_substrate_only.json @@ -0,0 +1,42 @@ +{ + "issue": 41, + "title": "Evaluate mined MLP substrate-only sufficiency for EN->PT", + "source_issue": 39, + "model": "tencent/HY-MT1.5-1.8B", + "task": "EN->PT translation", + "heldout_eval": "NTREX EN->PT, 1012 rows", + "judge": "Unbabel/XCOMET-XXL", + "baseline_xcomet": 0.9287162019683438, + "source_artifacts": { + "repo": "TokenBender/circuit-discovery", + "repo_type": "dataset", + "prefix": "circuit-shotting/artifacts/actdelta_lora_mlp_mvc/issue39_actdelta_lora_mlp_mvc_20260518T011201Z", + "mask": "selection/chunks/masks/final_mix_top_3.full.npz", + "rank256_factors": "factors/rank_256" + }, + "substrate": { + "name": "final_mix_top_3", + "channels": 5898, + "mlp_channel_universe": 196608, + "fraction": 0.0299993896484375 + }, + "systems": [ + { + "name": "native_mined_substrate_only", + "intervention": "At every MLP down_proj input, keep only final_mix_top_3 native channels and zero every other MLP channel." + }, + { + "name": "actdelta_rank256_substrate_only", + "intervention": "At every MLP down_proj input, write rank-256 ActDelta reconstructed selected channels and zero every other MLP channel." + } + ], + "fixed_surfaces": [ + "attention remains intact", + "residual stream remains intact", + "embeddings remain intact", + "layer norms remain intact", + "output head remains intact" + ], + "runner": "issue41_substrate_only_runner.sh", + "summary_script": "summarize_issue41_substrate_only.py" +} diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/summaries/issue41_summary.json b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/summaries/issue41_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..96b8e29224af8811b67d1345d2d98c544b99f53d --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/summaries/issue41_summary.json @@ -0,0 +1,36 @@ +{ + "run_root": "/root/runs/issue41_mined_substrate_only_c4354b4", + "baseline_xcomet": 0.9287162019683438, + "systems": [ + { + "system": "native_mined_substrate_only", + "rank": null, + "channels": 5898, + "params": null, + "scores": { + "chrFpp": 0.37995466816117174, + "chrF": 0.5010594194152935, + "BLEU": 0.0005806916822995268, + "n": 1012 + }, + "xcomet": 0.2118839286819925, + "recovery": 0.22814712205183943, + "method": "native selected MLP channels only; all other MLP channels zeroed" + }, + { + "system": "actdelta_rank256_substrate_only", + "rank": 256, + "channels": 5898, + "params": 2034176, + "scores": { + "chrFpp": 0.07855792684457256, + "chrF": 0.05595505685552267, + "BLEU": 0.0017090422944717233, + "n": 1012 + }, + "xcomet": 0.22047376124696297, + "recovery": 0.23739626893520915, + "method": "rank-256 ActDelta reconstruction of selected channels only; all other MLP channels zeroed" + } + ] +} diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/summaries/issue41_summary.md b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/summaries/issue41_summary.md new file mode 100644 index 0000000000000000000000000000000000000000..e3d55d02d842b1fab35176f3f7b1df4e9fd2ebdf --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/summaries/issue41_summary.md @@ -0,0 +1,8 @@ +# Issue 41 Mined MLP Substrate-Only Summary + +- Baseline XCOMET: `0.9287162019683438` + +| system | rank | channels | params | chrF++ | BLEU | XCOMET | recovery | +|---|---:|---:|---:|---:|---:|---:|---:| +| `native_mined_substrate_only` | `-` | `5898` | `-` | `0.37995466816117174` | `0.0005806916822995268` | `0.2118839286819925` | `0.22814712205183943` | +| `actdelta_rank256_substrate_only` | `256` | `5898` | `2034176` | `0.07855792684457256` | `0.0017090422944717233` | `0.22047376124696297` | `0.23739626893520915` | diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/xcomet/actdelta_rank256_substrate_only.json b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/xcomet/actdelta_rank256_substrate_only.json new file mode 100644 index 0000000000000000000000000000000000000000..226a76831fe240efb8a033f3721ab42a6f0f320e --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/xcomet/actdelta_rank256_substrate_only.json @@ -0,0 +1,126 @@ +{ + "health": [ + { + "idx": 0, + "base_url": "http://127.0.0.1:10001", + "health": { + "model_loaded": true, + "comet_model": "Unbabel/XCOMET-XXL", + "cuda": { + "available": true, + "device_count": 1, + "device_name": "NVIDIA RTX PRO 6000 Blackwell Workstation Edition", + "memory_allocated": 0, + "memory_reserved": 0 + } + } + } + ], + "summary": { + "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/dumps/ntrex/actdelta_rank256_substrate_only.jsonl", + "comet_model": "Unbabel/XCOMET-XXL", + "checkpoint_path": "/root/.cache/huggingface/hub/models--Unbabel--XCOMET-XXL/snapshots/873bac1b1c461e410c4a6e379f6790d3d1c7c214/checkpoints/model.ckpt", + "n": 1012, + "threshold": 0.99, + "system_score": 0.22047376124696297, + "passed": 0, + "elapsed_seconds": 701.6217973232269, + "batch_size": 8, + "chunk_size": 32, + "shard_count": 1, + "throughput_seg_per_s": 1.442372519173616 + }, + "outputs": { + "out_jsonl": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet/actdelta_rank256_substrate_only.scored_pool.jsonl", + "shard_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only" + }, + "shards": [ + { + "service": { + "idx": 0, + "base_url": "http://127.0.0.1:10001", + "health": { + "model_loaded": true, + "comet_model": "Unbabel/XCOMET-XXL", + "cuda": { + "available": true, + "device_count": 1, + "device_name": "NVIDIA RTX PRO 6000 Blackwell Workstation Edition", + "memory_allocated": 0, + "memory_reserved": 0 + } + } + }, + "shard_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", + "summary": { + "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", + "comet_model": "Unbabel/XCOMET-XXL", + "checkpoint_path": "/root/.cache/huggingface/hub/models--Unbabel--XCOMET-XXL/snapshots/873bac1b1c461e410c4a6e379f6790d3d1c7c214/checkpoints/model.ckpt", + "n": 1012, + "threshold": 0.99, + "system_score": 0.22047376124696297, + "passed": 0, + "elapsed_seconds": 701.5416388511658, + "batch_size": 8, + "chunk_size": 32, + "max_worker_batch_size": 8, + "max_batch_rows": 32, + "max_batch_wait_ms": 100, + "throughput_seg_per_s": 1.4425373184610868 + }, + "outputs": { + "out_jsonl": "/root/runs/issue41_mined_substrate_only_c4354b4/services/xcomet_0/issue41_actdelta_rank256_substrate_only_shard000/scored_pool.jsonl", + "summary_json": "/root/runs/issue41_mined_substrate_only_c4354b4/services/xcomet_0/issue41_actdelta_rank256_substrate_only_shard000/scored_pool.summary.json" + }, + "manifest": { + "source": "/root/runs/issue41_mined_substrate_only_c4354b4/services/xcomet_0/issue41_actdelta_rank256_substrate_only_shard000/scored_pool.jsonl", + "target_language": "Portuguese", + "thresholds": { + "sft_min_score": 0.85, + "preference_min_gap": 0.05, + "repair_max_score": 0.8, + "max_pairs_per_source": 3 + }, + "counts": { + "scored_pool": 1012, + "unique_sources": 1012, + "sft": 0, + "preferences": 0, + "repair_triples": 1012 + }, + "splits": { + "train": 788, + "test": 104, + "dev": 120 + }, + "systems": { + "issue41_actdelta_rank256_substrate_only_shard000": 1012 + }, + "categories": { + "ntrex_test": 1012 + }, + "score_distribution": { + "min": 0.16411660611629486, + "mean": 0.22047376124696297, + "median": 0.21810869127511978, + "max": 0.2613651752471924 + }, + "rejections": { + "sft": { + "below_sft_min_score": 1012 + }, + "preferences": { + "single_candidate_source": 1012 + }, + "repair_triples": {} + }, + "artifacts": { + "scored_pool": "/root/runs/issue41_mined_substrate_only_c4354b4/services/xcomet_0/issue41_actdelta_rank256_substrate_only_shard000/dataset/scored_pool.jsonl", + "sft": "/root/runs/issue41_mined_substrate_only_c4354b4/services/xcomet_0/issue41_actdelta_rank256_substrate_only_shard000/dataset/sft.jsonl", + "preferences": "/root/runs/issue41_mined_substrate_only_c4354b4/services/xcomet_0/issue41_actdelta_rank256_substrate_only_shard000/dataset/preferences.jsonl", + "repair_triples": "/root/runs/issue41_mined_substrate_only_c4354b4/services/xcomet_0/issue41_actdelta_rank256_substrate_only_shard000/dataset/repair_triples.jsonl" + } + } + } + ] +} diff --git a/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/xcomet/actdelta_rank256_substrate_only.scored_pool.jsonl b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/xcomet/actdelta_rank256_substrate_only.scored_pool.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..639907503cbcba2d5ec6e392dd84e5e00bc802ae --- /dev/null +++ b/circuit-shotting/artifacts/mined_substrate_only/issue41_mined_substrate_only_20260518T103722Z/xcomet/actdelta_rank256_substrate_only.scored_pool.jsonl @@ -0,0 +1,1012 @@ +{"row_id": 0, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.21650618314743042, "src": "Welsh AMs worried about 'looking like muppets'", "ref": "Deputados da Assembleia do País de Gales receiam “passar por Marretas”", "mt": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 0, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 0} +{"row_id": 1, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.23613905906677246, "src": "There is consternation among some AMs at a suggestion their title should change to MWPs (Member of the Welsh Parliament).", "ref": "Há uma consternação por parte de alguns Deputados da Assembleia do País de Gales (AM) relativamente à sugestão de que o seu título seja alterado para MWP (Deputados do Parlamento Galês).", "mt": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 1, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 1} +{"row_id": 2, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.1819932460784912, "src": "It has arisen because of plans to change the name of the assembly to the Welsh Parliament.", "ref": "A origem desta controvérsia está nos planos para alterar o nome da assembleia para \"Parlamento Galês\".", "mt": "逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 2, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 2} +{"row_id": 3, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.20761826634407043, "src": "AMs across the political spectrum are worried it could invite ridicule.", "ref": "Alguns membros dessa assembleia, provenientes de todas as cores políticas, receiam que tal os faça cair no ridículo.", "mt": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 3, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 3} +{"row_id": 4, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.2008594125509262, "src": "One Labour AM said his group was concerned \"it rhymes with Twp and Pwp.\"", "ref": "Um AM trabalhista afirmou que o grupo está preocupado com o facto de “a designação rimar com Twp e Pwp\".", "mt": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 4, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 4} +{"row_id": 5, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.20541442930698395, "src": "For readers outside of Wales: In Welsh twp means daft and pwp means poo.", "ref": "Para os leitores não galeses: na língua galesa, “twp” significa “idiota” e pwp significa “excrementos”.", "mt": "逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 5, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 5} +{"row_id": 6, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.1977691799402237, "src": "A Plaid AM said the group as a whole was \"not happy\" and has suggested alternatives.", "ref": "Um AM do Plaid afirmou que o grupo na sua globalidade “não estava contente” e sugeriu alternativas.", "mt": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 6, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 6} +{"row_id": 7, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.2428024560213089, "src": "A Welsh Conservative said his group was \"open minded\" about the name change, but noted it was a short verbal hop from MWP to Muppet.", "ref": "Um deputado conservador galês afirmou que o grupo estava de “mente aberta” em relação à alteração do nome, mas referiu que a designação MWP estava verbalmente muito próxima de Muppet (Marreta).", "mt": "...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"\n\n...\"", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 7, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 7} +{"row_id": 8, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.24693553149700165, "src": "In this context The Welsh letter w is pronounced similarly to the Yorkshire English pronunciation of the letter u.", "ref": "Neste contexto, a letra w em galês tem uma pronúncia semelhante à da letra u no inglês de Yorkshire.", "mt": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 8, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 8} +{"row_id": 9, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.1980632245540619, "src": "The Assembly Commission, which is currently drafting legislation to introduce the name changes, said: \"The final decision on any descriptors of what Assembly Members are called will of course be a matter for the members themselves.\"", "ref": "A Comissão da Assembleia, atualmente a elaborar legislação para introduzir as alterações de nome, declarou: \"A decisão final sobre a forma como os Deputados da Assembleia são designados será obviamente tomada pelos próprios\".", "mt": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 9, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 9} +{"row_id": 10, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.19855932891368866, "src": "The Government of Wales Act 2017 gave the Welsh assembly the power to change its name.", "ref": "A Lei do Governo do País de Gales de 2017 deu à sua assembleia os poderes para mudar de nome.", "mt": "高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低高低", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 10, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 10} +{"row_id": 11, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.21223348379135132, "src": "In June, the Commission published the results of a public consultation on the proposals which found broad support for calling the assembly a Welsh Parliament.", "ref": "Em junho, a Comissão publicou os resultados de uma consulta pública sobre as propostas, a qual registou um apoio generalizado à proposta de designar a assembleia por \"Parlamento Galês\".", "mt": "...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"...\"", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 11, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 11} +{"row_id": 12, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.1908920407295227, "src": "On the matter of the AMs' title, the Commission favoured Welsh Parliament Members or WMPs, but the MWP option received the most support in a public consultation.", "ref": "Sobre a questão do título dos AM, a Comissão favoreceu \"Deputados do Parlamento Galês”, ou WMP, mas a opção MWP foi mais favorecida numa consulta pública.", "mt": "逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐逐渐", "category": "ntrex_test", "tag": "heldout", "metadata": {"id": 12, "category": "ntrex_test", "tag": "heldout", "mask_name": "actdelta_rank256_substrate_only", "method": "actdelta_lora_mlp_substrate_only", "substrate_only": true, "rank": 256, "channels": 5898, "factor_dir": "/root/runs/issue41_mined_substrate_only_c4354b4/source_issue39/factors/rank_256"}, "id": 12} +{"row_id": 13, "source_path": "/root/runs/issue41_mined_substrate_only_c4354b4/xcomet_shards/actdelta_rank256_substrate_only/shard_000.jsonl", "system": "issue41_actdelta_rank256_substrate_only", "metric": "Unbabel/XCOMET-XXL", "score": 0.2546283006668091, "src": "AMs are apparently suggesting alternative options, but the struggle to reach consensus could be a headache for the Presiding Officer, Elin Jones, who is expected to submit draft legislation on the changes within weeks.", "ref": "Aparentemente, os AM estão a sugerir alternativas, mas o esforço para reunir o consenso pode constituir uma dor de cabeça para o Presidente, Elin Jones, que deverá apresentar um projeto de legislação sobre as alterações dentro de algumas semanas.", "mt": "...