TFix
A T5-large text-to-text Transformer fine-tuned to fix JavaScript coding errors reported by the ESLint static analyzer.
Language · 2,858 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Language
- Parameters
- 737.6M
- Operations
- 2,858
- Framework
- PyTorch
- Recurrent
- No
- Published
- ICML 2021
- Authors
- Berkay Berabi, Jingxuan He, Veselin Raychev, Martin Vechev
- Source
- GitHub: eth-sri/TFix
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m20787
- Graph hash
- 75492b917afca5b0b9a99600d1ccd32534fd27311061e451c26efe8dd187efd0
- Skeleton hash
- 66597555ec4c7e32d4020e8d677fb9de37ab8dd73bee6f93f31c96cecc8a9531
- Architecture hash
- c422e57751661a0dfafd5f1f3936e2b15f1f683cbcfca01558603001ded50d20
- Diagram SHA-256
- cb4f229b64db6676381031a5896ab7ed9bc59832e2c5ac2373159043e71c4ea1
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
TFix is a T5 text-to-text Transformer fine-tuned to fix coding errors in JavaScript programs. It works directly on program text and phrases the problem of code fixing as a text-to-text task. Given a coding error as text, it predicts a new text representing the code that fixes the error.
The errors come from ESLint, a static analyzer for JavaScript that locates the error line and outputs the error type and the error message. TFix extracts the error context, consisting of the error line and the two neighboring lines, and represents all information about the error as a single piece of text. The T5 model then generates new text that replaces the error context in the original program. The authors chose T5-large, which the paper reports has 770 million parameters, and implemented it with the transformers library. Input and output code text is represented with Byte Pair Encoding.
The fine-tuning data are aligned pairs of errors and fixes that the authors extracted from 5.5 million GitHub commits. Fine-tuning is done jointly on all 52 error types in the dataset, producing a single model, and the paper shows experimentally that this single model outperforms 52 individual models trained for each error type. On its clean test set the paper reports 49.3% accuracy on exact match, where a prediction counts only if it perfectly matches the human fix, and 67.8% accuracy on error removal.
Key idea. The paper phrases code fixing as a text-to-text task so that a Transformer pre-trained on natural language can be fine-tuned jointly on 52 error types.
- tfix
- program repair
- code fixing
- coding errors
- eslint
- javascript
- text-to-text transformer
- static analyzer errors
- learning-based code fixes
- github commits
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@article{tfix2021,
title = {TFix: Learning to Fix Coding Errors with a Text-to-Text Transformer},
author = {Berkay Berabi and Jingxuan He and Veselin Raychev and Martin Vechev},
year = {2021},
journal = {ICML 2021}
}