Downloads · 30 days
7
3% of all-time downloads
WENGSYX/CoNN_Copy
CoNN_Copy is a machine learning model from WENGSYX. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
In paper Neural Comprehension: Language Models with Compiled Neural Networks , we introduced the integration of Compiled Neural Networks (CoNN) into the framework of language models, enabling existing language models…
Downloads · 30 days
7
3% of all-time downloads
All-time downloads
215
Public
Repo size
39.9 KB
Likes
0
Public
Click a slice to open those files.
.bin39.9 KB · 90%
From the Hugging Face model README
In paper Neural Comprehension: Language Models with Compiled Neural Networks , we introduced the integration of Compiled Neural Networks (CoNN) into the framework of language models, enabling existing language models to perform symbolic operations with perfect accuracy without the need for external tools. In this model card, we introduce the Copy model, which is similar to the Transformer model and can be used to reproduce the output of the original text.
git clone https://github.com/WENGSYX/Neural-Comprehension
cd Neural-Comprehension
pip install .
To run neural comprehension, you need to install PyTorch, Transformers, jax, and tracr.
from NeuralCom.CoNN.modeling_conn import CoNNModel
from NeuralCom.CoNN import Tokenizer
model = CoNNModel.from_pretrained('WENGSYX/CoNN_Copy')
tokenizer = Tokenizer(model.config.input_encoding_map, model.config.output_encoding_map,model.config.max_position_embeddings)
output = model(tokenizer('a b c d a b c').unsqueeze(0))
print(tokenizer.decode(output.argmax(2)))
>>> [['bos', 'a', 'b', 'c', 'd', 'a', 'b', 'c']]
@misc{weng2023neural,
title={Neural Comprehension: Language Models with Compiled Neural Networks},
author={Yixuan Weng and Minjun Zhu and Fei Xia and Bin Li and Shizhu He and Kang Liu and Jun Zhao},
year={2023},
eprint={2304.01665},
archivePrefix={arXiv},
primaryClass={cs.CL}
}