Bring Your Own Data! Self-Supervised Evaluation for Large Language Models
The official code for Bring Your Own Data! Self-Supervised Evaluation for Large Language Models. If you have any questions, feel free to email (njain17@umd.edu).
About
To complement conventional evaluation, we propose a framework for self-supervised model evaluation. In this framework, metrics are defined as invariances and sensitivities that can be checked in a self-supervised fashion using interventions based only on the model in question rather than external labels. Self-supervised evaluation pipelines are dataset-agnostic, and so they can be utilized over larger corpora of evaluation data than conventional metrics, or even directly in production systems to monitor day-to-day performance. In this work, we develop this framework, discuss desiderata for such metrics, and provide a number of case studies for self-supervised metrics: knownledge capability, toxicity detection, long-range (context), word-order, and tokenization sensitivities. By developing these new metrics, we hope to provide a more comprehensive and nuanced understanding of the strengths and limitations of LLMs.
Installation
You can run pip install byod to directly install our package. Or, install directly from source via pip install git+https://github.com/neelsjain/BYOD/.
Dependencies
- transformers==4.28.1
- scipy==1.10.1
- torch==2.0.0
- datasets==2.11.0
- nltk==3.8.1
- apache_beam==2.48.0
Python 3.8 or higher is recommended
Usage
See run_model.sh for examples on how to evaluate a model. We provide scripts to run all huggingface models against metrics computed on wikipedia data, as an example. These are named run_[metric].py.
Note that only models are huggingface are currently supported.
You can also use the metrics directly, given your own model, tokenizer, and dataset, like so
import BYOD
long_range_sensitivity = BYOD.lrs_metric(model, data, tokenizer)
negation_knowledge = BYOD.negation_metric(model, data, tokenizer)
tokenization_robustness = BYOD.tokenization_metric(model, data, tokenizer)
toxicity_proxy = BYOD.toxicity_metric(model, data, tokenizer)
word_order_sensitivity = BYOD.word_order_metric(model, data, tokenizer)
Suggestions and Pull Requests are welcome!
Everything can be better! If you have suggestions on improving the codebase or the invariance/sensitivity test. Feel free to reach out!
Metadata
Release files for BYOD 0.3.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 |
|---|---|---|---|---|
| BYOD-0.3.0.tar.gz | 264.1 kB | Without provenance | Details for BYOD-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| BYOD-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for BYOD-0.3.0-py3-none-any.whl |
Total release size: 286.2 kB
Release files / BYOD-0.3.0.tar.gz
| Download URL | BYOD-0.3.0.tar.gz |
|---|---|
| Size | 264.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1eb6f2970e3cc5042e1a0edfdb596478112f843a62bc320ae297bac12a2a076
|
|
BLAKE2b-256 checksum How to use checksums |
148e173e5c1e7ffe71950be6a626f4a2e489dcb1ae5859c66b6a62a75c5e6b9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / BYOD-0.3.0-py3-none-any.whl
| Download URL | BYOD-0.3.0-py3-none-any.whl |
|---|---|
| Size | 22.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6b088133439c584633971594bb83211f0a90743546009f6c61bc986d6f51a6e
|
|
BLAKE2b-256 checksum How to use checksums |
fad9b67797f45b074abdd712c856876369429403f0dbff07d972c6aa133a01ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for BYOD 0.3.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.