Views
No views yet
1# Requires flash-linear-attention (https://github.com/fla-org/flash-linear-attention)
2import fla
3from transformers import AutoModelForCausalLM, AutoTokenizer
4model = AutoModelForCausalLM.from_pretrained(path_to_model).cuda()
5tokenizer = AutoTokenizer.from_pretrained(path_to_model).cuda()
6input_ids = tokenizer("All human beings are", return_tensors="pt").input_ids
7outputs = model.generate(input_ids, max_length=15)
8print(tokenizer.decode(outputs[0], skip_special_tokens=True))1@misc{he_alleviating_2025,
2 title = {Alleviating {Forgetfulness} of {Linear} {Attention} by {Hybrid} {Sparse} {Attention} and {Contextualized} {Learnable} {Token} {Eviction}},
3 url = {http://arxiv.org/abs/2510.20787},
4 doi = {10.48550/arXiv.2510.20787},
5 publisher = {arXiv},
6 author = {He, Mutian and Garner, Philip N.},
7 month = oct,
8 year = {2025},
9 note = {arXiv:2510.20787 [cs]},
10}