lmd
Code for paper titled "Language Model Decomposition: Quantifying the Dependency and Correlation of Language Models" (accepted EMNLP 2022). The arxiv version is here:
Install
Create virtual env if needed
python3 -m venv .venv
source .venv/bin/activate
Install from pip
pip install nlp.lmd
Install from source
git clone git@github.com:haozhg/lmd.git
cd lmd
pip install -e .
To use lmd cli, run lmd --help or python -m lmd.cli --help
$ lmd --help
usage: Language Model Decomposition [-h] [--target TARGET] [--basis BASIS]
[--tokenizer-name TOKENIZER_NAME]
[--max-seq-length MAX_SEQ_LENGTH]
[--batch-size BATCH_SIZE]
[--dataset-name DATASET_NAME]
[--dataset-config-name DATASET_CONFIG_NAME]
[--val-split-percentage VAL_SPLIT_PERCENTAGE]
[--test-split-percentage TEST_SPLIT_PERCENTAGE]
[--max-train-samples MAX_TRAIN_SAMPLES]
[--max-val-samples MAX_VAL_SAMPLES]
[--max-test-samples MAX_TEST_SAMPLES]
[--preprocessing-num-workers PREPROCESSING_NUM_WORKERS]
[--overwrite_cache OVERWRITE_CACHE]
[--preprocess-dir PREPROCESS_DIR]
[--embedding-dir EMBEDDING_DIR]
[--results-dir RESULTS_DIR]
[--models-dir MODELS_DIR] [--alpha ALPHA]
[--log-level LOG_LEVEL]
[--try-models TRY_MODELS]
[--pre-select-multiplier PRE_SELECT_MULTIPLIER]
[--seed SEED]
Results
To reproduce the results in Appendix B of the paper, run bash scripts/run.sh. The results are also stored in results/128k
Metadata
Release files for nlp.lmd 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nlp.lmd-0.2.0.tar.gz | 15.6 kB | Without provenance | Details for nlp.lmd-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nlp.lmd-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for nlp.lmd-0.2.0-py3-none-any.whl |
Total release size: 29.9 kB
Release files / nlp.lmd-0.2.0.tar.gz
| Download URL | nlp.lmd-0.2.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
066fcbded2df9150b6bd6c3671e39a33b8e7a67af6476408b9559422c10069c5
|
|
BLAKE2b-256 checksum How to use checksums |
185b8418e2eeee423651b5b24521f6da7307afd8437fd77ed69763b0e06876a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.5
|
Release files / nlp.lmd-0.2.0-py3-none-any.whl
| Download URL | nlp.lmd-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
497bb055ccdb4b30134ea3eda187e3fefca24256a86ad96dd8a27a2991d12b0e
|
|
BLAKE2b-256 checksum How to use checksums |
a3f27cefeae3a0dddc42bde7350b6167e3cd79b73b940ce4f7cd72a248c1fa28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.5
|
Security for nlp.lmd 0.2.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.
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.