hn.today

Show HN: LLM weight editing tool made by a 15-year-old

github.com12 points2 comments
Screenshot of Show HN: LLM weight editing tool made by a 15-year-old

Laplace’s Scissors is an open-source tool for editing large language models’ output weights, built by a 15-year-old using Rust and Triton for CUDA and HIP GPUs. Rather than retraining a model, it searches for rotations of the output matrix that can improve weak or incorrect responses while preserving selected behaviors. Its commands cover fetching and inspecting models, probing output behavior, repairing answers, generating text, exporting edited checkpoints, and comparing behavior across model sizes. Users can provide test cases with prompts, answer choices, and the correct choice.

The probe process injects equal-sized vectors into a model’s decoder and compares the resulting output distributions using Jeffreys divergence to identify directions the model distinguishes poorly. It can trace relevant layer contributions and weight coordinates, then propose a bounded rotation that aims to increase discrimination while preserving specified outputs and hidden-state references. For answer repair, the tool searches rotation planes using expected answer tokens and checks candidates on actual GPU outputs; successful original generations can be protected, while failed answers must meet a specified logit margin over competing tokens. The project also includes scaling analysis and records model and input hashes, hardware, precision, and validation results for reproducibility. It requires a Rust toolchain, Python with Triton, and a compatible CUDA or HIP setup.

Read on github.com2 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in AI

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.