LLM-based feature generation from text for interpretable machine learning

Vojtěch Balek, Lukáš Sýkora, Vilém Sklenák, Tomáš Kliegr
9/11/2024
cs.LGcs.CL

No official code found. Best implementation: vojtech-balek/llm-features (5 stars, MIT, last commit 2025-06-27).

Abstract

Existing text representations such as embeddings and bag-of-words are not suitable for rule learning due to their high dimensionality and absent or questionable feature-level interpretability. This article explores whether large language models (LLMs) could address this by extracting a small number of interpretable features from text. We demonstrate this process on two datasets (CORD-19 and M17+) containing several thousand scientific articles from multiple disciplines and a target being a proxy for research impact. An evaluation based on testing for the statistically significant correlation with research impact has shown that LLama 2-generated features are semantically meaningful. We consequently used these generated features in text classification to predict the binary target variable representing the citation rate for the CORD-19 dataset and the ordinal 5-class target representing an expert-awarded grade in the M17+ dataset. Machine-learning models trained on the LLM-generated features provided similar predictive performance to the state-of-the-art embedding model SciBERT for scientific text. The LLM used only 62 features compared to 768 features in SciBERT embeddings, and these features were directly interpretable, corresponding to notions such as article methodological rigor, novelty, or grammatical correctness. As the final step, we extract a small number of well-interpretable action rules. Consistently competitive results obtained with the same LLM feature set across both thematically diverse datasets show that this approach generalizes across domains.

View on arXivView PDF

Code Implementations(1)

MIT

Repository for code backing the article "LLM-based feature generation from text for interpretable machine learning".

52Python, Jupyter NotebookAug 8, 20241 years agoMIT
explainable-aiexplainable-mlllms

Similar Papers

Cite this paper

@article{balek2024llmbased,
  title  = {LLM-based feature generation from text for interpretable machine learning},
  author = {Vojtěch Balek and Lukáš Sýkora and Vilém Sklenák and Tomáš Kliegr},
  year   = {2024},
  eprint = {2409.07132},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.07132v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.07132.svg)](https://codeofpaper.com/paper/2409.07132)

Discussion