Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adadec-0.1.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adadec-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

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

Hashes for adadec-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6766137b4fdd79d25d80463a11e7e08e700d4f4221eb7f70ea81370cbf40e777
MD5 37b71c2c141f58a770c8f3d6fddfcc33
BLAKE2b-256 a1e4747f1eb1e0a0e2fade7922eacad8561ba10bb0dba632abd5e6cff656456d

See more details on using hashes here.

Provenance

The following attestation bundles were made for adadec-0.1.0.tar.gz:

Publisher: python-publish.yml on Arw-Wow/AdaDec_pypi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for adadec-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fff9c41f1b5ff2b5f8165e62f253463eb4d48c0ebae310a0c9a0973ecaa3e03d
MD5 11ffb29aab23db620497da36734e13b9
BLAKE2b-256 53690d8671852ee1c90b746c663a98f326990a7d05aaf1b93f80f81a0e7d69b9

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page