# Overview

<div align="left"><figure><img src="/files/vXpoDT3JTgRQrinHSXC5" alt="" width="166"><figcaption><p><strong>An Easy-to-use Knowledge Editing Framework for Large Language Models.</strong></p></figcaption></figure></div>

### ![](https://img.shields.io/badge/version-v0.0.1-blue) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) ![Static Badge](https://img.shields.io/badge/last_commit-July-blue) ![](https://img.shields.io/badge/PRs-Welcome-red)

**EasyEdit** is a Python package built upon [PyTorch](https://pytorch.org/) for edit Large Language Models (LLM) like `GPT-J`, `Llama`, `GPT-NEO`, `GPT2`, `T5`(support models from **1B** to **65B**), altering the behavior of LLMs efficiently without negatively impacting performance across other inputs.

If you find EasyEdit useful, please kindly cite this [paper](https://arxiv.org/abs/2305.13172).

```tex
@misc{yao2023editing,
      title={Editing Large Language Models: Problems, Methods, and Opportunities}, 
      author={Yunzhi Yao and Peng Wang and Bozhong Tian and Siyuan Cheng and Zhoubo Li and Shumin Deng and Huajun Chen and Ningyu Zhang},
      year={2023},
      eprint={2305.13172},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
```

***

### Model Editing

<div align="center"><img src="/files/fQ7Lw6BZK9VSnZ66Gxph" alt="" height="70%" width="70%"></div>

Deployed models may still make unpredictable errors. For example, Large Language Models (LLMs) notoriously *hallucinate*, *perpetuate bias*, and *factually decay*, so we should be able to adjust specific behaviors of pre-trained models.

**Model editing** aims to adjust an initial base model's ($$f\_{\theta}$$) behavior on the particular edit descriptor $$\[x\_e, y\_e]$$ efficiently, such as(The president of USA: Donald Trump -> Joe Biden):

* $$x\_e$$: Who is the president of the US
* $$y\_e$$: Joe Biden

without influencing the model behavior on unrelated samples. The ultimate goal is to create an edited model ($$f\_{\theta}'$$).

### Colab Tutorial

You can go colab directly

* [colab link](https://colab.research.google.com/drive/1zcj8YgeqttwkpfoHXz9O9_rWxFFufXSO)

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zjunlp.gitbook.io/easyedit/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
