News

Senior project spotlight: Katrina Brown

Making AI language models more consistent and fair

Harvard SEAS student Katrina Brown

For a senior thesis, computer science student Katrina Brown devised a method of making AI language models more consistent in how they process information.

Fourth-year computer science concentrators at the Harvard John A. Paulson School of Engineering and Applied Sciences (SEAS) have the option to write senior theses. Often taken for course credit through “CS91R: Supervised Reading and Research,” their theses seek to contribute to the general understanding of some problems within computer science.

Order Dependence in LLMs

Katrina Brown, A.B. ‘25, Computer Science

Advisor: Cynthia Dwork

• Please give a brief summary of your project.

My project is about making artificial intelligence (AI) language models – like the ones that power chatbots or answer questions – more consistent and fair. These models sometimes give different answers depending on the order of the information you give them, even if the meaning doesn’t change. For example, if you ask a multiple-choice question and shuffle the options, the model might pick a different answer, which isn’t ideal if you’re relying on it for something important like a doctor summarizing research papers. I created a method called the Multidimensional Attention Mask that fixes this by making the model treat the options as a group, not a list with a specific order. It’s like telling the AI to look at everything at once instead of step-by-step, so the order doesn’t mess it up.

• How did you come up with this idea for your final project?

I got the idea from reading about how language models behave oddly compared to humans. These models can be strangely sensitive to little changes, like the order of options in a question. Prior work bemoans the ‘order dependency’ problem, like how models might favor the first or last option just because of its position. We wondered, ‘Why hasn’t anyone made them ignore the order completely?’ I was already interested in how these models pay attention to words through what’s known as the attention mechanism, so I started wondering if I could tweak that to solve the problem. Talking with Reid McIlroy, a postdoc at the Hire Aspirations Institute here at Harvard, helped me to refine the problem into a concrete proposed solution and run experiments to confirm the theory.

• What was the timeline of your project?

I began talking with my advisor, Cynthia Dwork, in January of my junior year, and I did most of the initial coding and experiments for the first part of my thesis in my junior spring. We submitted the paper "Order-Independence Without Fine Tuning," writing up these results, to NeurIPS in May 2024. I ran additional experiments for the method without fine-tuning later in the summer and fall, mostly for rebuttals for the NeurIPS paper. From December through February, I ran additional experiments augmenting the method with fine-tuning, submitted a following paper with those results to an International Conference on Learning Representations workshop in February, and finished the final writeup for the actual thesis combining the results from these two papers in early Spring 2025.

• What part of the project proved the most challenging?

The hardest part was the initial ramping up period. I hadn't worked with large language models before, so I spent a while learning about core concepts and implementations. The fine-tuning experiments were tricky too, because I had to figure out how to train the model without breaking its other skills or running into out-of-memory issues, but the initial ramping up period was the most mind-expanding.

• What part of the project did you enjoy the most

I loved seeing the experiments come together. After all the theory and coding, running the tests and watching the model give the same answer no matter how I shuffled the options was so satisfying – like, ‘Wow, it actually works!’ I also really enjoyed thinking about the bigger picture – how this could make AI fairer and more reliable. It felt like I was doing something that could actually matter.

• What did you learn, or skills did you gain, through this project?

Technically, I got way better at working with transformer models – coding them, tweaking their attention mechanisms, and running experiments with big datasets. I became intimately familiar with the quirks of the SLURM computing cluster, and how to batch out jobs efficiently. On the research side, I learned how to take a vague idea, dig into the literature, and turn it into something structured and testable. I got better at managing a long project too, balancing theory, coding, and writing over months. And honestly, explaining it to my friends who aren’t in CS made me better at breaking down complicated concepts into simple terms. Technical communication is an incredibly valuable skill!

Topics: Academics, Computer Science

Press Contact

Matt Goisman | mgoisman@g.harvard.edu