Skip to main content

Polyprobe is a research library for training and evaluating lightweight binary-classification probes over representations within language-model attention heads. While many prior probing studies have been implemented as task-specific experiments, Polyprobe provides reusable infrastructure for:

  • efficient training of independent probes across hundreds of attention heads;
  • memory-mapped activation storage and GPU-aware batching;
  • head ranking and model selection;
  • evaluation and interactive inference.

The details of individual experiments, on the other hand, are specified via a number of swappable abstractions that can either be selected from what the library already has to offer or registered at runtime:

  • the architecture of the language model being investigated;
  • the features to learn;
  • the source of the training data;
  • the definition of positive and negative examples;
  • the vector representations to probe;
  • the type of probe to use;
  • the metric to use to select probe results;
  • optionally, how probe results are pooled.

I am currently using Polyprobe to investigate how grammatical dependencies are represented and processed by language models. On held-out English Web Treebank data, pooled Qwen3-4B probes reached 82.28% average precision for subject-before-head dependencies and 83.57% for head-before-object dependencies against positive prevalences of 0.49% and 0.29% respectively. The probes can be tested against user-entered sentences via a simple analysis console:

The dog saw the cat

nsubj:  dog (3: 7) ->  saw (7: 11) (strictest met threshold: 25%)
obj:  cat (15: 19) ->  saw (7: 11) (strictest met threshold: 15%)

For more information, please see the main documentation on GitHub.

Metadata

Release files for polyprobe 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polyprobe 1.0.1
File Size Uploaded Provenance Actions
polyprobe-1.0.1.tar.gz 114.2 kB Without provenance Details for polyprobe-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polyprobe 1.0.1
File Interpreter ABI Platform Actions
polyprobe-1.0.1-py3-none-any.whl Python 3 none any Details for polyprobe-1.0.1-py3-none-any.whl

Total release size: 217.7 kB

Release files / polyprobe-1.0.1.tar.gz

Download URL polyprobe-1.0.1.tar.gz
Size 114.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cd8cb7f6398d7c3220965e1fabe9de044abda6c1043c1b4e9b422e50908c25be
BLAKE2b-256 checksum
How to use checksums
199441266bf4aedf5727915d3d8de02aaa34d8f84ff14ca501900ccd44216977
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / polyprobe-1.0.1-py3-none-any.whl

Download URL polyprobe-1.0.1-py3-none-any.whl
Size 103.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd7dfa7b1de384ccc2cabc1aff1e7ae77ae5646d227c199e4c12ef7dd55d74c8
BLAKE2b-256 checksum
How to use checksums
7045213fbbe23cbc9441d8f22b4f237a8260b4daaedf176e00efb8a2c13b411c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Security for polyprobe 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page