Ranking Entities along Conceptual Space Dimensions with LLM s: An Analysis of Fine-Tuning Strategies (2024)

Abstract: Conceptual spaces represent entities in terms of their primitive semantic features. Such representations are highly valuable but they are notoriously difficult to learn, especially when it comes to modelling perceptual and subjective features. Distilling conceptual spaces from Large Language Models (LLMs) has recently emerged as a promising strategy, but existing work has been limited to probing pre-trained LLMs using relatively simple zero-shot strategies. We focus in particular on the task of ranking entities according to a given conceptual space dimension. Unfortunately, we cannot directly fine-tune LLMs on this task, because ground truth rankings for conceptual space dimensions are rare. We therefore use more readily available features as training data and analyse whether the ranking capabilities of the resulting models transfer to perceptual and subjective features. We find that this is indeed the case, to some extent, but having at least some perceptual and subjective features in the training data seems essential for achieving the best results.

## introduction knowledge graphs (kgs) have emerged as the de facto standard for representing knowledge in areas such as natural language processing @xcite , recommendation @xcite and search @xcite . however, much of the knowledge that is needed in applications is about graded properties, e.g. recipes being healthy, movies being original or cities being kids-friendly. such knowledge is easiest to model in terms of rankings: we can rank recipes according to how healthy they are even if we cannot make a hard decision about which ones are healthy and which ones are not. for this reason, we argue that con-ceptual spaces @xcite should be used, alongside knowledge graphs, in many settings. a conceptual space specifies a set of quality dimensions, which correspond to primitive semantic features. for instance, in a conceptual space of movies, we might have a quality dimensions reflecting how original a movie is. entities are represented as vectors, specifying a suitable feature value for each quality dimension. while the framework of conceptual spaces is more general, we will essentially view quality dimensions as rankings. conceptual spaces have the potential to play a central role in various knowledge-intensive applications. in the context of recommendation, for instance, they could clearly complement the factual knowledge that is captured by typical kgs (e.g. modelling the style of a movie, rather than who directed it), making it easier to infer user preferences from previous ratings. they could also be used to make recommendations more controllable, as in the case of critiquing-based systems, allowing users to specify feedback of the form "like this movie, but more kids-friendly" @xcite . conceptual spaces furthermore serve as a natural interface between neural and symbolic representations @xcite , and may thus enable principled explainable ai methods. however, the task of learning conceptual spaces has proven remarkably challenging. the issue of reporting bias @xcite , in particular, has been regarded as a fundamental obstacle: the knowledge captured by conceptual spaces is often so obvious to humans that it is rarely stated in text. for instance, the phrase "green banana" is more frequent in text than "yellow banana" @xcite , as the colour is typically not specified when yellow bananas are discussed. @xcite found that predictions of language models (lms) about the colour of objects were correlated with the distribution of colour terms in text corpora, rather than with human judgements, suggesting that lms cannot overcome the challenges posed by reporting bias. however, @xcite found that larger lms can perform much better on this task. going beyond colour, @xcite evaluated the ability of llms to predict taste-related features, such as sweetness and saltiness, obtaining mixed results: the rankings predicted by llms, in a zero-shot setting, had a reasonable correlation with human judgments but they were not consistently better than those produced by a fine-tuned bert @xcite model. in this paper, we analyse whether llms can be fine-tuned to extract better conceptual space representations. the difficulty is that ground truth rankings are typically not available when it comes to perceptual and subjective features, outside a few notable exceptions such as the aforementioned taste dataset. we therefore explore whether more readily available features can be used for fine-tuning the model. for instance, we can obtain ground truth rankings from wikidata entities with numerical attributes (e.g. the length of rivers, the birth date of people, or the population of cities) and then use these rankings to fine-tune an llm. we furthermore compare two different strategies for ranking entities with an llm: the pointwise approach uses an llm to assign a score to each entity, given some feature, while the pairwise approach uses an llm to decide which among two given entities has the feature to the greatest extent. our contributions and findings can be summarised as follows: lms as knowledge bases our focus in this paper is on extracting knowledge from language models. this idea of language models as knowledge bases was popularised by @xcite , who showed that the pre-trained bert model captures various forms of factual knowledge, which can moreover be extracted using a simple prompt. work in this area has focused on two rather distinct goals. on the one hand, probing tasks, such as the one proposed by @xcite , have been used as a mechanism for analysing and comparing different language models. on the other hand, extracting knowledge from lms has also been studied as a practical tool for building or extending symbolic knowledge bases. this has been particularly popular for capturing types of knowledge which are not commonly found in traditional knowledge bases, such as commonsense knowledge @xcite @xcite . several works have focused on distilling kgs from language models @xcite . @xcite studied this problem for non-traditional relations such as "is capable of but not good at". along the same lines, @xcite have focused on modelling relations that are a matter of degree, such as "is a competitor of" or "is similar to". we can similarly think of the conceptual space dimensions that we consider in this paper as gradual properties. where the aforementioned approaches explicitly extract knowledge from an lm, the knowledge captured by lms has also been used implicitly, by applying such models in a wide range of knowledgeintensive applications, including closed-book question answering @xcite , knowledge graph completion @xcite , recommendation @xcite , entity typing @xcite and ontology alignment @xcite , to name just a few. ## extracting rankings we consider the following problem: given a set of entities e and a feature f , rank the entities in e according to the their value for the feature f . in some cases, f will refer to a numerical attribute. for instance, e may be a set of countries and f the population of a country, where the task is then to rank the countries according to their population. in other cases, f will rather refer to a gradual property. for instance, e may be a set of food items and f may be the level of sweetness. let us write f (e) for the value of feature f for entity e. we consider two broad strategies for solving the considered ranking task with llms. first, we can use llms to map each entity e to some score w(e), with the assumption that w(e 1 ) < w(e 2 ) iff f (e 1 ) < f (e 2 ). this pointwise approach to learning to rank is considered in section 3.2. second, we can use llms to solve a binary classification problem: given two entities e 1 and e 2 , decide whether f (e 1 ) < f (e 2 ) holds. this pairwise approach needs to be combined with a strategy for aggregating the llm predictions into a single ranking. the main disadvantage is that a large number of judgements need to be collected for this to be effective, which means that such approaches are less efficient than pointwise strategies. however, in the context of document retrieval, pairwise approaches have been found to outperform pointwise approaches @xcite @xcite . we discuss pairwise and pointwise strategies in sections 3.1 and 3.2 respectively. finally, section 3.3 describes how we establish baseline results using chatgpt and gpt4. ## datasets in our experiments, we will rely on the following datasets, either for training or for testing the models. each dataset consists of a number of rankings, where each ranking is defined by a set of entities and a feature along which the entities are ranked. wikidata we have obtained 20 rankings from numerical features that are available on wikidata foot_2 . for instance, we obtained a ranking of rivers by comparing their length. 4 if there were more than 1000 entities with a given feature value, we selected the most 1000 popular entities. to estimate the popularity of an entity, we use their qrank foot_4 , which counts the number of page views of the corresponding entry in sources such as wikipedia. for the entity type person, we limited the analysis to people born in london (which made it possible to retrieve the required information from wikidata more efficiently). we similarly only considered museums located in italy. for some experiments, we split the collected data in two datasets, called wd1 and wd2. this will allow us to test whether models trained on one set of features (i.e. wd1) generalise to a different set of features (i.e. wd2). wd1 contains rankings which were cut off at 1000 elements, whereas wd2 contains rankings with fewer elements. we will write wd to refer to the full dataset, i.e. wd1 and wd2 combined. taste following chatterjee et al. (2023), we use a dataset with ratings about the taste of 590 food items along six dimensions: sweetness, sourness, saltiness, bitterness, fattiness and umaminess. the dataset was created by @xcite , who used a panel of twelve experienced food assessors to rate the items. we use the version of the dataset that was cleaned by @xcite , who altered some of the descriptions of the items to make them sound more natural in prompts. 6 rocks nosofsky et al. ( 2018 ) created a dataset of rocks, with the aim of studying how cognitively meaningful representation spaces for complex domains can be learned. a total of 30 rock types were studied (10 igneous rocks, 10 metamorphic rocks and 10 sedimentary rocks). for each type of rock, 12 pictures were obtained, and each picture was annotated along 18 dimensions. however, only 7 of the considered dimensions allow for ranking all types: lightness of colour, average grain size, roughness, shininess, organisation, variability of colour and density. for our experiments, we only considered these dimensions. the dataset from nosofsky et al. ( 2018 ) contains ratings for each of the 12 pictures of a given rock type, where each picture was assessed by 20 annotators. to construct rankings of rock types, we average the ratings across the 12 pictures. as such, we end up with 7 rankings of 30 rock types. tag genome @xcite collected a dataset foot_6 of movies, called the tag genome, by asking annotators to what extent different tags apply to different movies, on a scale from 1 to 5. from these tags, we first selected those that correspond to adjectives and for which ratings for at least 15 movies were available. we then manually identified 38 of these adjectives which correspond to ordinal features. more recently, @xcite created a similar dataset for books. we again selected adjectives for which at least 15 items were ranked, and manually identified 32 adjectives that correspond to ordinal features. a list of the adjectives that we considered is provided in the appendix. it should be noted that most items are only judged by a single annotator, and the judgements were moreover obtained using crowdsourcing. the movies and books datasets are thus clearly noisier than the taste and rocks datasets. for this reason, we will only consider aggregated results across all tags when evaluating on these datasets. we will write tg to refer to the combined dataset, containing both the books and movies rankings. ## experiments we now evaluate the performance of the fine-tuning strategies on the considered datasets. foot_7 comparing models we can see in by the llms themselves, rather than knowledge that was injected during the fine-tuning process. this suggests that pre-trained llms capture more perceptual knowledge than it may initially appear. comparing ranking strategies the pointwise model can be directly used for this purpose. for the pairwise model, we show results with the svm strategy and the count strategy. we furthermore vary the number of pairwise judgments per entity (5 or 30) for count and svm. for this experiment, we use the pointwise and pairwise llama3-8b models that were trained on wd+tg+rocks. we evaluate the different models by comparing the predicted rankings with the ground truth in terms of spearman ρ. we can see that the pairwise approaches consistently outperform the pointwise model. the svm method generally performs better than the count method, especially in the case where 30 judgments per entity are obtained. we also compare with the gpt-3 results reported by @xcite , finding that the pairwise llama model consistently performs best. qualitative analysis the rankings for scary and funny movies were obtained with the model that was trained on wd+taste+rocks. the ranking for population was obtained with the model that was trained on wd1. the table shows that the model was successful in selecting these top and bottom ranked entities. the top-ranked entities for sweetness, for instance, are all clearly sweet food items, while none of the bottom ranked entities are. similar observations can be made for the other features. the model is sometimes less successful in distinguishing middleranked entities from bottom-ranked entities. for instance, most cheeses appear at the bottom of the ground truth ranking, whereas the model predicted these to be somewhere closer to the middle. 11 for population, we can see that while the top-ranked entities are all countries with a high population, their relative ranking is not accurate. to further test the ability of the model to generalise to unseen properties, ## conclusions we have studied the problem of ranking entities along conceptual space dimensions, such as sweetness (for food), roughness (for rocks) or scary (for movies). we found that fine-tuning llms on data from one domain (e.g. taste) is a viable strategy for learning to extract rankings in unrelated domains (e.g. rocks), as long as both domains are perceptual. in contrast, llms that were fine-tuned on objective numerical features from wikidata were less successful when applied to perceptual domains. when comparing pairwise and pointwise strategies, surprisingly, we found that pointwise methods were as successful as pairwise methods for making pairwise judgements (i.e. should entity e 1 be ranked before entity e 2 ), although pairwise methods still had the advantage when such judgments were aggregated. overall, our results suggest that the current generation of open-source llms, such as llama and mistral, can be effectively used for constructing high-quality conceptual space representations. however, further work is needed to construct more comprehensive training sets. encouragingly, we found that subjective (and relatively noisy) rankings, such as those from the movies and books datasets, can also be effective, while being much easier to obtain than perceptual features. results are possible with different choices. furthermore, while we have tested a number of different llms, it is possible that other (existing or future) models of similar sizes may behave qualitatively different. care should therefore be taken when drawing any conclusions about the limitations of llms in general. moreover, the limitations we have identified might be particular to the specific fine-tuning techniques that we have used, rather than reflecting limitations of the underlying llms. when it comes to modelling subjective features, such as those in the movies and books datasets, it is important to acknowledge that people may have different points of view. when using conceptual space representations extracted from llms in downstream applications, we thus need to be aware that these representations are biased and, at best, can only represent a majority opinion.