Views
No views yet
1from airrep import AirRep
2
3model = AirRep.from_pretrained("sunweiwei/AirRep-Flan-Small")
4
5train_texts = [
6 "Question: Classify the sentiment of 'The movie was wonderful and heartwarming.'\
7Answer: positive",
8 "Question: Does the hypothesis entail the premise? Premise: 'A man is playing a guitar on stage.' Hypothesis: 'Someone is performing music.'\
9Answer: entailment",
10]
11query_texts = [
12 "Question: Classify the sentiment of 'The service was awful and I won't return.'\
13Answer: negative"
14]
15
16# Embeddings and influence-like similarity score
17train_emb = model.encode(train_texts, batch_size=128)
18query_emb = model.encode(query_texts)
19score = model.similarity(query_emb, train_emb, softmax=True)
20print("Similarity score:", score)1@inproceedings{Sun2025AirRep,
2 title= {Enhancing Training Data Attribution with Representational Optimization},
3 author = {Weiwei Sun and Haokun Liu and Nikhil Kandpal and Colin Raffel and Yiming Yang},
4 year = {2025},
5 booktitle={NeurIPS},
6 year={2025},
7 url={https://arxiv.org/abs/2505.18513}
8}