AdaDec is an uncertainty-guided adaptive decoding framework for large language model (LLM) code generation which enhances standard decoding with a selective pause-then-rerank mechanism triggered by model uncertainty.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file adadec-0.1.0.tar.gz.
File metadata
- Download URL: adadec-0.1.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6766137b4fdd79d25d80463a11e7e08e700d4f4221eb7f70ea81370cbf40e777
|
|
| MD5 |
37b71c2c141f58a770c8f3d6fddfcc33
|
|
| BLAKE2b-256 |
a1e4747f1eb1e0a0e2fade7922eacad8561ba10bb0dba632abd5e6cff656456d
|
Provenance
The following attestation bundles were made for adadec-0.1.0.tar.gz:
Publisher:
python-publish.yml on Arw-Wow/AdaDec_pypi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adadec-0.1.0.tar.gz -
Subject digest:
6766137b4fdd79d25d80463a11e7e08e700d4f4221eb7f70ea81370cbf40e777 - Sigstore transparency entry: 560186112
- Sigstore integration time:
-
Permalink:
Arw-Wow/AdaDec_pypi@c7b58938e920fa9ad7a6d8893808278108705ec0 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Arw-Wow
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c7b58938e920fa9ad7a6d8893808278108705ec0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file adadec-0.1.0-py3-none-any.whl.
File metadata
- Download URL: adadec-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fff9c41f1b5ff2b5f8165e62f253463eb4d48c0ebae310a0c9a0973ecaa3e03d
|
|
| MD5 |
11ffb29aab23db620497da36734e13b9
|
|
| BLAKE2b-256 |
53690d8671852ee1c90b746c663a98f326990a7d05aaf1b93f80f81a0e7d69b9
|
Provenance
The following attestation bundles were made for adadec-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on Arw-Wow/AdaDec_pypi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
adadec-0.1.0-py3-none-any.whl -
Subject digest:
fff9c41f1b5ff2b5f8165e62f253463eb4d48c0ebae310a0c9a0973ecaa3e03d - Sigstore transparency entry: 560186129
- Sigstore integration time:
-
Permalink:
Arw-Wow/AdaDec_pypi@c7b58938e920fa9ad7a6d8893808278108705ec0 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Arw-Wow
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c7b58938e920fa9ad7a6d8893808278108705ec0 -
Trigger Event:
release
-
Statement type: