File size: 2,825 Bytes
0042bb4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
datasets:
- huawei-noah/python_text2code
tags:
- python
- code
---

# Model Card for pangu-CodeCLM-partial-300m

- **Repository:** https://github.com/huawei-noah/noah-research/tree/master/NLP/text2code_mrpt
- **Paper:** https://aclanthology.org/2024.eacl-long.72.pdf

## Model Description

This model is a PanGu-Alpha model further trained on text-to-code pairs
collected from public github repositories.
Training was performed with the CodeCLM objective, i.e. causal language modeling calculating loss only over code tokens and partial embedding separation (only Python-specific tokens are assigned a different embedding).

In order to use the model, first download it from the hub and have a look at the [evaluation section](https://github.com/huawei-noah/noah-research/blob/master/NLP/text2code_mrpt/README.md#evaluation).


## Citation [optional]

**BibTeX:**

```html
@inproceedings{christopoulou-etal-2024-text,
    title = "Text-to-Code Generation with Modality-relative Pre-training",
    author = "Christopoulou, Fenia  and
      Zhang, Guchun  and
      Lampouras, Gerasimos",
    editor = "Graham, Yvette  and
      Purver, Matthew",
    booktitle = "Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month = mar,
    year = "2024",
    address = "St. Julian{'}s, Malta",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.eacl-long.72",
    pages = "1194--1208",
    abstract = "Large pre-trained language models have recently been expanded and applied to programming language tasks with great success, often through further pre-training of a strictly-natural language model{--}where training sequences typically contain both natural and (linearised) programming language. Such approaches effectively map both modalities of the sequence into the same embedding space. However, programming language keywords (e.g. {``}while{''}) often have very strictly defined semantics. As such, transfer learning from their natural language usage may not necessarily be beneficial to their code application and vise versa. Assuming an already pre-trained language model, in this work we investigate how sequence tokens can be adapted and represented differently, depending on which modality they belong to, and to the ultimate benefit of the downstream task. We experiment with separating embedding spaces between modalities during further model pre-training with modality-relative training objectives. We focus on text-to-code generation and observe consistent improvements across two backbone models and two test sets, measuring pass@$k$ and a novel incremental variation.",
}
```

## Model Card Authors [optional]

[Fenia Christopoulou](mailto:[email protected])