Datasets:
ArXiv:
License:
Improve ConceptEdit dataset card: Add metadata, links, and sample usage
#1
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
|
| 5 |
-
|
| 6 |
<div align="center">
|
| 7 |
|
| 8 |
**Editing Conceptual Knowledge for Large Language Models**
|
|
@@ -10,14 +15,15 @@ license: cc-by-nc-sa-4.0
|
|
| 10 |
---
|
| 11 |
|
| 12 |
<p align="center">
|
| 13 |
-
<a href="
|
| 14 |
-
<a href="
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
</p>
|
| 19 |
</div>
|
| 20 |
|
|
|
|
| 21 |
|
| 22 |
## 💡 Conceptual Knowledge Editing
|
| 23 |
|
|
@@ -30,37 +36,37 @@ license: cc-by-nc-sa-4.0
|
|
| 30 |
**Concept** is a generalization of the world in the process of cognition, which represents the shared features and essential characteristics of a class of entities.
|
| 31 |
Therefore, the endeavor of concept editing aims to modify the definition of concepts, thereby altering the behavior of LLMs when processing these concepts.
|
| 32 |
|
| 33 |
-
|
| 34 |
### Evaluation
|
| 35 |
|
| 36 |
-
To analyze conceptual knowledge modification, we adopt the
|
| 37 |
|
| 38 |
- `Reliability`: the success rate of editing with a given editing description
|
| 39 |
- `Generalization`: the success rate of editing **within** the editing scope
|
| 40 |
- `Locality`: whether the model's output changes after editing for unrelated inputs
|
| 41 |
|
| 42 |
-
|
| 43 |
Concept Specific Evaluation Metrics
|
| 44 |
|
| 45 |
- `Instance Change`: capturing the intricacies of these instance-level changes
|
| 46 |
- `Concept Consistency`: the semantic similarity of generated concept definition
|
| 47 |
|
|
|
|
| 48 |
|
| 49 |
-
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
| **Method** | GPT-2 | GPT-J | LlaMA2-13B-Chat | Mistral-7B-v0.1
|
| 54 |
-
| :--------------: | :--------------: | :--------------: | :--------------: | :--------------: |
|
| 55 |
-
| FT | ✅ | ✅ | ✅ | ✅ |
|
| 56 |
-
| ROME | ✅ | ✅ |✅ | ✅ |
|
| 57 |
-
| MEMIT | ✅ | ✅ | ✅| ✅ |
|
| 58 |
-
| PROMPT | ✅ | ✅ | ✅ | ✅ |
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
| 64 |
|
| 65 |
## 📖 Citation
|
| 66 |
|
|
@@ -81,4 +87,4 @@ Please cite our paper if you use **ConceptEdit** in your work.
|
|
| 81 |
|
| 82 |
We would like to express our sincere gratitude to [DBpedia](https://www.dbpedia.org/resources/ontology/),[Wikidata](https://www.wikidata.org/wiki/Wikidata:Introduction),[OntoProbe-PLMs](https://github.com/vickywu1022/OntoProbe-PLMs) and [ROME](https://github.com/kmeng01/rome).
|
| 83 |
|
| 84 |
-
Their contributions are invaluable to the advancement of our work.
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-sa-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- knowledge-editing
|
| 7 |
+
- llm
|
| 8 |
+
- conceptual-knowledge
|
| 9 |
---
|
| 10 |
|
|
|
|
| 11 |
<div align="center">
|
| 12 |
|
| 13 |
**Editing Conceptual Knowledge for Large Language Models**
|
|
|
|
| 15 |
---
|
| 16 |
|
| 17 |
<p align="center">
|
| 18 |
+
<a href="https://huggingface.co/papers/2403.06259">Dataset Paper (ConceptEdit)</a> •
|
| 19 |
+
<a href="https://zjunlp.github.io/project/ConceptEdit">Dataset Website</a> •
|
| 20 |
+
<a href="https://github.com/zjunlp/EasyEdit">EasyEdit GitHub</a> •
|
| 21 |
+
<a href="https://huggingface.co/papers/2504.15133">Framework Paper (EasyEdit2)</a> •
|
| 22 |
+
<a href="https://zjunlp.github.io/project/EasyEdit2/">Framework Website (EasyEdit2)</a>
|
| 23 |
</p>
|
| 24 |
</div>
|
| 25 |
|
| 26 |
+
This repository contains the `ConceptEdit` dataset, which facilitates the evaluation of Large Language Models (LLMs) in open-domain natural language-driven molecule generation tasks. It is part of the `EasyEdit` framework, designed for plug-and-play adjustability in controlling LLM behaviors.
|
| 27 |
|
| 28 |
## 💡 Conceptual Knowledge Editing
|
| 29 |
|
|
|
|
| 36 |
**Concept** is a generalization of the world in the process of cognition, which represents the shared features and essential characteristics of a class of entities.
|
| 37 |
Therefore, the endeavor of concept editing aims to modify the definition of concepts, thereby altering the behavior of LLMs when processing these concepts.
|
| 38 |
|
|
|
|
| 39 |
### Evaluation
|
| 40 |
|
| 41 |
+
To analyze conceptual knowledge modification, we adopt the metrics for factual editing (the target is the concept $C$ rather than factual instance $t$).
|
| 42 |
|
| 43 |
- `Reliability`: the success rate of editing with a given editing description
|
| 44 |
- `Generalization`: the success rate of editing **within** the editing scope
|
| 45 |
- `Locality`: whether the model's output changes after editing for unrelated inputs
|
| 46 |
|
|
|
|
| 47 |
Concept Specific Evaluation Metrics
|
| 48 |
|
| 49 |
- `Instance Change`: capturing the intricacies of these instance-level changes
|
| 50 |
- `Concept Consistency`: the semantic similarity of generated concept definition
|
| 51 |
|
| 52 |
+
## 🚀 Sample Usage
|
| 53 |
|
| 54 |
+
You can load the ConceptEdit dataset using the `EasyEdit` framework as follows:
|
| 55 |
|
| 56 |
+
```python
|
| 57 |
+
from easyeditor import ConceptEditDataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
+
# For example, to load the ConceptEdit dataset
|
| 60 |
+
# Assuming 'data/concept_data.json' is the path to your dataset file
|
| 61 |
+
concept_config = ConceptEditDataset.get_hparams()
|
| 62 |
+
concept_train_ds = ConceptEditDataset('./data/concept_data.json', config=concept_config)
|
| 63 |
+
concept_eval_ds = ConceptEditDataset('./data/concept_data.json', config=concept_config)
|
| 64 |
|
| 65 |
+
print(f"Loaded {len(concept_train_ds)} training samples.")
|
| 66 |
+
print(f"Loaded {len(concept_eval_ds)} evaluation samples.")
|
| 67 |
+
# You can inspect a sample:
|
| 68 |
+
# print(concept_train_ds[0])
|
| 69 |
+
```
|
| 70 |
|
| 71 |
## 📖 Citation
|
| 72 |
|
|
|
|
| 87 |
|
| 88 |
We would like to express our sincere gratitude to [DBpedia](https://www.dbpedia.org/resources/ontology/),[Wikidata](https://www.wikidata.org/wiki/Wikidata:Introduction),[OntoProbe-PLMs](https://github.com/vickywu1022/OntoProbe-PLMs) and [ROME](https://github.com/kmeng01/rome).
|
| 89 |
|
| 90 |
+
Their contributions are invaluable to the advancement of our work.
|