zwiad

Run the Zwiad geometry-analysis protocol with concept decomposition over stored activations: measure signal, geometry, decomposition, intervention and editability, and name discovered concepts with an LLM.

Basic Usage
python -m wisent zwiad (--from-database | --from-cache PATH) --model MODEL --steps STEPS [OPTIONS]

Examples

Analyze from the database
python -m wisent zwiad   --from-database   --model meta-llama/Llama-3.1-8B-Instruct   --task truthfulqa_custom   --prompt-format chat --extraction-strategy chat_last   --extraction-component residual_stream   --steps all   --llm-model gpt-4o-mini --concept-naming-n-samples 20   --visualizations-dir ./zwiad_viz   --output ./zwiad.json
Analyze from a local cache
python -m wisent zwiad   --from-cache ./activations.pkl   --model meta-llama/Llama-3.1-8B-Instruct   --prompt-format chat --extraction-strategy chat_last   --extraction-component residual_stream   --steps signal,geometry   --llm-model gpt-4o-mini --concept-naming-n-samples 20   --visualizations-dir ./zwiad_viz

Arguments

Data Source (choose one)

ArgumentDescription
--from-databaseLoad activations from the Supabase database
--from-cache PATHLoad activations from a local cache pickle file

Required

ArgumentDescription
--modelModel name in database
--prompt-formatPrompt format used for activations (chat or completion)
--extraction-strategyToken extraction strategy (last_token, first_token, chat_last)
--extraction-componentTransformer component to extract from (residual_stream, attn_output, mlp_output, ...)
--stepsProtocol steps: all, signal, geometry, decomposition, intervention, editability, or comma-separated
--llm-modelLLM model for concept naming
--concept-naming-n-samplesSamples used for LLM concept-naming prompts
--visualizations-dirDirectory to save visualization PNGs

Options

ArgumentDefaultDescription
--task(none)Task name (required for --from-database; enables concept naming for --from-cache)
--layersallLayers to analyze: range (8-16) or comma-separated (8,10,12)
--output(none)Output file path for JSON results
--database-urlDATABASE_URL envDatabase URL
--no-visualizationsoffDisable visualization generation

The geometry metrics expose additional design-choice tuning flags (probe, direction-stability, consistency, sparsity and detection thresholds); run wisent zwiad --help for the full list.

Related Commands

Stay in the loop. Never miss out.

Subscribe to our newsletter and unlock Wisent insights.