Advancements in Large Language Models (LLMs) have highlighted the critical need for aligning their outputs with the diverse preferences of user groups. The risks of bias and misrepresentation should be addressed. Traditional methods such as supervised fine-tuning and strategic prompting often fall short in terms of efficiency or effectiveness. Our research introduces a novel Group Preference Aligner (GPA) model that significantly enhances group-specific alignment by leveraging a two-stage process. Initially, we use a universal aligner to adjust LLM outputs towards universally beneficial attributes like safety and harmlessness. Subsequently, we fine-tune this model using only adapter modules tailored to the specific preferences of individual groups, enhancing the LLM's ability to cater to nuanced group characteristics, while increasing the parameters marginally. We introduce a new synthetic DescriptiveOpinionQA dataset to model more descriptive group preferences beyond multiple-choice options in the OpinionQA dataset. We demonstrate the effectiveness of our approach using the OpinionQA and our synthetic DescriptiveOpinionQA datasets. Our findings show that the GPA model aligns more closely with group-specific preferences compared to existing models.
LLMs frequently exhibit biased representations, disproportionately emphasizing or neglecting certain groups. Directive prompts like "Speak as [specific identity or role]" offer a partial solution by providing contextual cues, yet they risk misrepresentation and have inherent limitations. Historically, methods such as supervised fine-tuning, strategic prompting, and learning from contextual examples have been used to align LLM outputs with user or group preferences. These methods, however, often prove to be inefficient or ineffective.
The recent Group Preference Optimization (GPO) approach tries to address these challenges. GPO leverages a framework that aligns LLM outputs with the preferences of various groups using a few-shot learning paradigm. This method uses an auxiliary transformer module that predicts the preferences of a group based on the outputs of a base LLM among the options provided.
Group alignment in GPO aims to steer pretrained LLMs to preferences catering to a wide range of groups. For each group g, the preference dataset is represented as Dg = {(x1g, y1g), ..., (xng, yng)}. Here, yig signifies the preference of group g for a pair of given prompt qig and response rig, while xig is its LLM representation obtained with πemb(qig, rig), as shown in Figure 1.
As shown in Figure 2 and 3, a set of few known input-output pairs from a group, (x1, y1), (x2, y2), ..., (xm, ym) are provided as the context points along a base prompt. These provide the model with known preferences for the given inputs. Preferences ŷm+1, ..., ŷn for new inputs (xm+1, 0), ..., (xn, 0) are predicted based on the patterns learned from the context points.
Despite its advantages, GPO has limitations. GPO predicts distribution of options for a given question and not the direct answer. This makes it difficult to directly use it as an LLM or as an extension to LLM. GPO is a few-shot paradigm, depending heavily on the context and thus can struggle with longer context lengths.
Parallel to GPO, there is another line of work: Aligner. The Aligner model represents a novel approach to aligning LLMs with human opinions without the need for Reinforcement Learning from Human Feedback (RLHF) processes. It doesn't rely on reward model training and actor-critic engineering. It operates on the principle of learning correctional differences between aligned and unaligned responses directly from the data, structured as an autoregressive sequence-to-sequence (seq2seq) model trained on query-answer-correction (Q-A-C) triples. Given a question and output of an LLM as Answer, Aligner predicts the potential correction that is more aligned to safety and harmlessness.
The Aligner model stacks upon an upstream LLM. This model corrects the answers of the upstream LLM's output and redistributes the initial answers, thus aligning the composed LLM responses towards the aligned distribution. Aligner takes the user’s query x and the initial answer yo generated by the upstream LLM, then generates the answer yc which is better aligned as required. The seq2seq model is trained to redistribute the preliminary answers yo to the aligned answer yc as shown in Figure 4 and 5.
Aligner can be integrated with any pre-existing LLM making it model agnostic. This Plug-and-Play capability enhances its alignment capabilities without the need for direct modifications to the underlying LLM. Aligner demonstrates significant improvements in metrics such as helpfulness and harmlessness, achieving these gains with lower computational demands compared to traditional RLHF methods.
Building upon the foundational work of the Aligner model, we introduce an innovative extension, Group Preference Aligner (GPA), that significantly enhances group-specific alignment for LLMs. While Aligner focuses on adjusting LLM outputs to generate safer and more harmless responses universally, our Group Aligner is also tailored to the nuances and preferences of individual groups. Specifically, we propose a two-stage alignment process: The first stage involves training a universal aligner as mentioned in the aligner paper to address common preferences across groups (such as safety and harmlessness) and the second stage involves fine-tuning the model by incorporating adapter modules to align with the nuanced preferences of individual groups.
We use the below two datasets.
The datasets are processed to get to question-answer-correction (Q-A-C) format following Aligner. Q is the question that is directly picked from OpinionQA. A is the overall distribution answer. C is the corrected response that the Aligner is supposed to generate and align the answer A to the respective group.
An example question answer distribution from the dataset is shown below.
Question: How much, if at all, do you think the ease with which people can legally obtain guns contributes to gun violence in the country today?Since the OpinionQA dataset provides distribution statistics of the options selected at the group level, and the overall statistics; we select the answer with high probability from the overall group as the answer from the LLM. The correction for each group is the option with high probability from the answer distribution for the respective question. This would let Aligner correct the responses to generate group opinions.
An example question-answer-correction generated for Democrat and Republican groups is shown below.
Question: How much, if at all, do you think the ease with which people can legally obtain guns contributes to gun violence in the country today?To generate better descriptive responses, we leveraged GPT-3.5-Turbo and constructed synthetic answers and corrections for each group. We use the following group level prompts and get a response for each question available in the OpinionQA dataset.
group_intepretation_map = {
"Overall": "Consider yourself as a United States citizen.",
"Democrat": "Consider yourself as a United States citizen. In today's United States politics, you are Democrat.",
"Republican": "Consider yourself as a United States citizen. In today's United States politics, you are Republican.",
"$100,000 or more": "Consider yourself as a United States citizen. Your total family annual income from all sources before taxes is $100,000 or more.",
"Less than $30,000": "Consider yourself as a United States citizen. Your total family annual income from all sources before taxes is less than $30,000."
}
Data generation follows this sequence:
system_prompt = f"""
{group_intepretation_map[Group]}
Answer this survey question from your perspective in a brief sentence.
Don't start the answer with your description or group affiliation.
The answer should reflect your concerns and life experiences relevant to the topic."
"""
user_prompt = f"Question: {Question}."
chat_completion = openai_client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt}
],
temperature=0.5
)
response = chat_completion.choices[0].message.content
The responses generated for the question in the Overall group is considered as the default response (answer) from the language model, followed by the responses for individual groups as the corrections to the overall answers.
An example question-answer-correction generated for Democrat and Republican groups is shown below.
Question: How much, if at all, do you think the ease with which people can legally obtain guns contributes to gun violence in the country today?For our project, we chose specific groups such as income (Less than $30,000, $100,000 or more) and political orientation(Democrat, Republican) based on their disparate nature, as demonstrated in the OpinionQA data analysis.
Our method builds on the Aligner model. It has two stages.
By following the above changes to training strategies to start from a similar first stage base, the second stage training should give a good idea about the differences among the GPA and GPO approaches.
We use NVIDIA Quadro RTX 8000 and NVIDIA A100 GPUs available on NYU Greene HPC. To finetune Aligner models on OpinionQA and DescriptiveOpinionQA we use the aligner codebase. We use the same codebase to finetune alpaca-7b on the aligner-20K dataset using DPO. To train GPO we follow the code provided at .
Specifically,We evaluate the performance of all the trained models through qualitative and quantitative estimates. For qualitative evaluation, we manually evaluate generated responses on the evaluation set and compare its alignment with the correction compared to the answer. For quantitative evaluation, we chose the Rouge metric due to its relevance in assessing the quality of descriptive outputs. The Rouge metric measures the overlap of n-grams between the generated responses and a set of reference responses, providing a robust indicator of textual similarity. It is important to note, however, that while the ROUGE metric offers a useful estimate of similarity, it is not the ideal metric for evaluating all aspects of response quality. Particularly for more descriptive answers, this value may be lower, indicating that ROUGE can sometimes fail to capture the nuanced content and creativity of the responses.
Following are some qualitative examples from the individual adapters:
Question: Thinking about long-range foreign policy goals, how much priority, if any, do you think reducing legal immigrations into the US should be given? Question: How much, if at all, do you think the following proposals would do to reduce economic inequality in the U.S.? Expanding government benefits for the poor.From the above examples we can see that the generated corrections for each of the groups follow the expected tone as in their groundtruth response.
Rouge scores for GPA trained on DescriptiveOpinionQA dataset for individual adapters trained separately for each group and a common adapter trained collectively for all groups can be seen in the figure below. We follow a train-test split of 90%-10%.
The results indicate comparable performance between the single adapter setting and individual adapters, suggesting that adding more parameters could further enhance the results.
Training and Evaluation Dynamics of GPO: When training GPO by splitting groups into train and eval (90% of groups training, 10% of groups evaluation), the rouge scores and alignment scores (of the predicted distributions, calculated using Wasserstein Distance) are notably high in comparison to taking eval split from all the groups, for both with 22 groups and with a subset of groups. This suggests potential overfitting to familiar questions. The below plots showing the rouge score and alignment score clearly highlights this.
Classification vs. Regression Discrepancies: The evaluation may inherently favor the GPO model as it predicts a probability distribution over options rather than generating direct text. This setup tends to yield higher Rouge scores for GPO, where direct text generation introduces more variability and challenge in matching the exact content of options.
Adaptation to New Groups: Scalability poses a challenge across various alignment models, including our own. Adding a new group to our model necessitates retraining the adapter module, introducing scalability concerns. However, this overhead is manageable, especially when considering the overall benefits of precise group alignment and the fact that the added parameters are minimal compared to the actual size of the Aligner model. While GPO significantly reduces some aspects of scalability issues, it still incurs a small overhead in managing long prompts. It requires the pre-computation of embeddings for all Q&As at the outset. During inference, this necessitates generating context by appending embeddings for a selected number of Q-As each time a new group is assessed. Despite these challenges, both models manage the added complexity with relatively low overhead, maintaining usability and effectiveness across various settings.
Inconsistent Output Formats: The outputs from LLMs did not adhere to a common format, necessitating extensive post-processing to shape the data into a usable form for training. This involved significant cleaning and manipulation to meet the desired data format.
Temperature Tuning: Adjusting the generation temperature of the LLM was crucial to balance creativity and relevance in the responses, ensuring that the data generated met our expectations.
Prompt Engineering: Crafting the right prompts was a big challenge. We needed to avoid generic responses that could apply uniformly across all groups as well as overly scripted or obvious answers, such as "Given I am a democrat, according to my view, ...". Finding the precise phrasing to elicit useful and varied responses required extensive experimentation.
Sparse Data for Each Group: The limited amount of training data available for each group made it impractical to train models like Aligner from scratch. Thus, we were focused primarily on fine-tuning existing models.
Handling Incomplete Sentences: We encountered data examples with incomplete sentences. These cause trouble in training aligner given it doesn't know the full question to answer as expected by the ground truth. Examples include:
{
"key": "LEGALIMG_W41",
"question": "In order to maintain the strength of the U.S. economy over the next 30 years, do you think that legal immigration will need to be",
"answer": "Maintained at current levels",
"correction": "Maintained at current levels"
},
{
"key": "LOCALELECT_W29",
"question": "The next question is about local elections, such as for mayor or a school board. Do you",
"answer": "Always vote in local elections",
"correction": "Never vote in local elections"
}
Out-of-Memory Issues:
Exploring DeepSpeed Zero Stages: We had to experiment with different DeepSpeed Zero optimization stages to find the right balance between memory usage and computational time.
Precision and Efficiency: To manage these large models effectively, we loaded them in lower bit resolutions (e.g., using 16-bit precision) for more memory-efficient training, while maintaining calculations in 32-bit to preserve accuracy.