Skip to main content

AdaDec: Adaptive Decoding for Code Generation

AdaDec is an adaptive decoding framework for LLM code generation. It selectively pauses decoding when uncertainty is high, reranks candidates, and improves accuracy with moderate overhead.

Installation

pip install adadec

Quick Start

from adadec import prepare_adadec, generate_adadec
prepare_adadec(model, tokenizer, "train.jsonl", "out.parquet", "mymodel", "thresholds.json")
result = generate_adadec(model, tokenizer, ["def add(a, b):"], "mymodel")

Note that train.jsonl requires "task_id", "prompt", and "canonical_solution".

stop_words.json example:

["\\n{4,}", "^\\S"]

📖 License

MIT License

Links

Metadata

Release files for adadec 0.1.0

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

Source distribution (sdist)

Source distribution for adadec 0.1.0
File Size Uploaded Provenance
adadec-0.1.0.tar.gz 10.3 kB With provenance Details

Built distribution (wheel)

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

Total release size: 20.8 kB

Release files / adadec-0.1.0.tar.gz

Download URL adadec-0.1.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6766137b4fdd79d25d80463a11e7e08e700d4f4221eb7f70ea81370cbf40e777
BLAKE2b-256 checksum
How to use checksums
a1e4747f1eb1e0a0e2fade7922eacad8561ba10bb0dba632abd5e6cff656456d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2025.

Transparency log

Release files / adadec-0.1.0-py3-none-any.whl

Download URL adadec-0.1.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fff9c41f1b5ff2b5f8165e62f253463eb4d48c0ebae310a0c9a0973ecaa3e03d
BLAKE2b-256 checksum
How to use checksums
53690d8671852ee1c90b746c663a98f326990a7d05aaf1b93f80f81a0e7d69b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2025.

Transparency log

Security for adadec 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for adadec-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2025.

Transparency log

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

0.1.0 This release

2 release files Full 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