4.8 KiB
4.8 KiB
base_model, tags, license, language
| base_model | tags | license | language | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Llama3.1_8b_Ins_Arxiv_4096 |
|
apache-2.0 |
|
Model usage example
import transformers
import torch
torch.set_default_tensor_type(torch.cuda.HalfTensor)
model_id = "xinyifang/ProductsLlama"
pipeline = transformers.pipeline(
"text-generation",
model = model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto",
)
def LLMClassifier(description):
messages = [
{"role": "system", "content": "Based on the given product description, determine the most appropriate category. Output only the corresponding category number (no additional text or formatting). Part of the 47 categories are: 0,Home & Kitchen; 1,Health & Personal Care; 2,Beauty; 3,Sports & Outdoors; 4,Books; 5,'Patio, Lawn & Garden'; 6,Toys & Games; 7,CDs & Vinyl; 8,Cell Phones & Accessories; 9,Grocery & Gourmet Food; 10,'Arts, Crafts & Sewing'; 11,'Clothing, Shoes & Jewelry'; 12,Electronics; 13,Movies & TV; 14,Software; 15,Video Games; 16,Automotive; 17,Pet Supplies; 18,Office Products; 19,Industrial & Scientific; 20,Musical Instruments; 21,Tools & Home Improvement; 22,Magazine Subscriptions; 23,Baby Products; 25,Appliances; 26,Kitchen & Dining; 27,Collectibles & Fine Art; 28,All Beauty; 29,Luxury Beauty; 30,Amazon Fashion; 31,Computers; 32,All Electronics; 33,Purchase Circles; 34,MP3 Players & Accessories; 35,Gift Cards; 36,Office & School Supplies; 37,Home Improvement; 38,Camera & Photo; 39,GPS & Navigation; 40,Digital Music; 41,Car Electronics; 42,Baby; 43,Kindle Store; 44,Buy a Kindle; 45,Furniture & Decor"},
{"role": "user", "content": f"{description}"},
]
outputs = pipeline(
messages,
max_new_tokens=128000,
)
return outputs[0]["generated_text"][-1]['content']
# Adding more neighbors can help with the accuracy, for example, " - linked with node '{neighbor_discription}'.\n"
description = "Graph representation learning has become a critical task across various domains such as social networks and recommender systems. Recently, the rise of large language models (LLMs) has opened up new possibilities for processing text-attributed graphs (TAGs), where nodes are associated with textual information. Despite promising progress, applying LLMs to TAGs faces significant challenges, including input window size limitations and the computational overhead of handling large-scale graphs. To address these challenges, we propose a novel approach that leverages a multi-profiling framework as a data augmentation method, thereby increasing the diversity and quantity of the training samples. The profiles/summaries generated by each of the five profiling/summarizing models are then combined with the graph structure, prompts and ground-truth labels to create a comprehensive and varied fine-tuning data. By strategically selecting profiling models with an appropriate number of neighboring nodes and constructing concise yet informative fine-tuning prompts, our proposed approach enables LLMs to process more complex graphs while operating within limited computational resources. Notably, our experiments demonstrate that it is unnecessary to construct intricate graph structures for fine-tuning to achieve strong performance. Our approach outperforms 11 state-of-the-art baselines, achieving 74.31\% accuracy and 85.15\% accuracy in two large real-world benchmark datasets, ogbn-arxiv and ogbn-products, respectively. Furthermore, our model is publicly available on Hugging Face"
predict_label = LLMClassifier(description)
print(predict_label) # 4 (This is the abstract of our paper, so classifying it as "4,Books" is reasonable)
Uploaded model
- Developed by: xinyifang
- License: apache-2.0
- Finetuned from model : Llama3.1_8b_Ins_Arxiv_4096
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
Citation
This model is from our paper LLM Profiling and Fine-Tuning with Limited Neighbor Information for Node Classification on Text-Attributed Graphs:
@INPROCEEDINGS{11401710,
author={Fang, Xinyi and Lee, Kyumin and Li, Yichuan},
booktitle={2025 IEEE International Conference on Big Data (BigData)},
title={LLM Profiling and Fine-Tuning with Limited Neighbor Information for Node Classification on Text-Attributed Graphs},
year={2025},
volume={},
number={},
pages={5613-5622},
keywords={Training;Representation learning;Accuracy;Social networking (online);Computational modeling;Large language models;Data models;Tuning;Recommender systems;Faces},
doi={10.1109/BigData66926.2025.11401710}}
