What I Learned from Writing My First ML Paper
TL;DR
HypeLoRA was my first serious machine learning research project. The paper started from a simple question:
Can parameter-efficient fine-tuning methods adapt a language model while preserving, or even improving, its calibration?
The short answer is: sometimes.
LoRA was surprisingly strong. It often matched full fine-tuning not only in task performance, but also in calibration. But the result was not uniform across tasks. Hypernetwork-generated LoRA adapters were also interesting, especially on CoLA, but they did not magically solve calibration. The most important lesson for me was that reliability is not a single number. A model can become more accurate and less calibrated at the same time.
This post is not a formal summary of the paper. It is a personal write-up about what I learned while working on it.
Why I became interested in calibration
Most beginner ML projects are evaluated with accuracy.
That is understandable: accuracy is simple, intuitive, and easy to compare.
But accuracy does not answer a very important question:
When the model says it is 90% confident, is it actually correct around 90% of the time?
This is the calibration question.
For many applications, especially those involving decision-making, uncertainty matters. A model that is right 90% of the time but overconfident on the remaining 10% can be dangerous. It may look strong in benchmark tables while still being unreliable in the way it communicates uncertainty.
This became the central motivation behind HypeLoRA. We did not only want to ask whether fine-tuning improves downstream performance. We wanted to ask whether fine-tuning changes the model’s confidence behavior.
The core idea
The project focused on finetuning RoBERTa on GLUE benchmark classification tasks. We compared standard full fine-tuning with LoRA-based adaptation and then tested a hypernetwork-based variant.
The intuition behind LoRA is simple: instead of updating all parameters of a large model, we inject low-rank trainable updates into selected weight matrices. In our case, the backbone remains frozen and only a small number of adaptation parameters are trained.
HypeLoRA takes this one step further. Instead of learning every LoRA matrix independently, a shared hypernetwork generates low-rank factors for multiple layers.
The hope was that this would create some form of structured coupling across layers. Instead of treating each layer as an independent adaptation target, the hypernetwork might learn a more global adaptation strategy.

At a high level, I learned that this idea is elegant, but elegance is not enough. The architecture has to survive contact with actual experiments, random seeds and of course has to provide good results.
Lesson 1: accuracy and calibration can disagree
One of the most important lessons was that better task performance does not automatically mean better calibration.
In some GLUE tasks, LoRA improved or matched full fine-tuning while also achieving competitive calibration. In others, full fine-tuning had better ECE even when LoRA had slightly better downstream performance.
That was a useful reality check. It is easy to think of a “better model” as a single direction. In practice, different metrics can pull in different directions.

That is especially relevant for reliable AI. A system does not only need to produce good predictions. It also needs to communicate uncertainty in a way that downstream users or systems can interpret.
Lesson 2: LoRA is not just about efficiency
Before this project, I mostly thought about LoRA as a parameter-efficiency technique.
That is still true: LoRA is useful because it lets us adapt models while training far fewer parameters than full fine-tuning. But HypeLoRA made me think about LoRA differently.
LoRA is also a constraint on how the model can change.
That constraint can affect generalization, overfitting, and calibration. In some settings, restricting the update space may act as a useful regularizer. In others, it may limit performance or fail to correct overconfidence.
This changed how I think about PEFT methods. They are not just engineering tricks for cheaper training. They define a specific adaptation geometry: what kinds of changes are easy, what kinds are hard, and what kinds are impossible.
Lesson 3: hypernetworks are powerful, but not magic
The hypernetwork idea was the most interesting part of the project for me.
Instead of directly training LoRA matrices, we trained a network that generates them. This is appealing because it suggests a more dynamic form of adaptation. A hypernetwork could, in principle, learn shared structure across layers or tasks.
In practice, the results were mixed.
The Transformer-based hypernetwork with full matrix generation achieved the best CoLA MCC among the tested variants, slightly outperforming standard LoRA. But it did not create a consistent calibration advantage. The A-fixed variant improved ECE, but this came with a cost in task performance.

The lesson was important:
Adding a more structured architecture does not automatically fix reliability.
It may introduce useful inductive bias, but the effect has to be measured carefully. In our case, structural coupling alone was not enough to systematically correct confidence estimates.
Lesson 4: constraints can improve calibration by reducing freedom
One of the most interesting observations was the behavior of the A-fixed variants.
When the A matrices were fixed and only the B matrices were generated or trained, calibration often improved. But this improvement came at a cost: task performance decreased.
This made me think of calibration as partially connected to model freedom. If the model has too much freedom, it may become sharper and more confident. That can help the training objective, but it can hurt uncertainty estimates.
The training curves showed this clearly: longer training could continue improving task metrics while worsening calibration.
This was one of the most useful research lessons from the project:
More training is not always better if the metric you care about is reliability.
That also means early stopping should not only monitor accuracy or validation loss. If calibration matters, calibration metrics should be part of the training loop.
What I would do differently now
If I were starting the project again, I would change a few things.
First, I would design the experimental tracking system earlier. Reproducibility becomes much harder when runs, seeds, configs, and metrics are not standardized from the beginning. At the beginning of the project all of my run were just named “run_1”, “run_2” etc. As you can imagine, this names do not provide any information about the experiment and make it extremely hard to remember the exact setup used.
Second, I would include stronger distribution shift experiments. Calibration is especially important when the test distribution differs from the training distribution. Evaluating only in-distribution classification tasks gives an incomplete picture of reliability. This is and idea that was suggested to me by an audience member, while I was presenting this paper. The question this person asked was fairly simple:
Would our approach behave differently if we trained it on much smaller datasets and then evaluate it on the original dataset?
Finally, I would think earlier about what failure would teach us. The most useful outcome of a research project is not always a clean win. Sometimes the most valuable result is understanding why a plausible idea does not consistently work.
How this changed my research interests
HypeLoRA pushed me toward credible AI and reliable evaluation.
I became less interested in simply making models larger or slightly more accurate, and more interested in questions like:
- Can we design adaptation methods that improve both performance and calibration?
- How does fine-tuning change model confidence?
- When do models become overconfident?
- Can parameter-efficient adaptation preserve uncertainty estimates?
- How should we evaluate reliability beyond accuracy?
- What trade-offs appear when we constrain the adaptation space?
These questions feel important because modern AI systems are increasingly used as components in larger decision-making pipelines. In that setting, confidence and reliability are not secondary details. They are part of the system behavior.
Main takeaways
The biggest things I learned from HypeLoRA were:
Accuracy is not enough.
A model can improve on a task while becoming less reliable in its confidence estimates.LoRA is a reliability-relevant adaptation method.
It is not only cheaper than full fine-tuning; it also constrains how the model can change.Hypernetworks are promising but difficult.
Generating adapters dynamically is elegant, but the calibration benefit is not automatic.Regularization can improve calibration at the cost of performance.
The A-fixed variants showed a clear trade-off between predictive performance and ECE.
What comes next
I want to continue working on reliable adaptation of language models.
The next direction I find especially interesting is studying how PEFT methods affect model behavior under distribution shift and adversarial prompts.
The broader question is:
Can we adapt models efficiently without making their behavior harder to trust?
That is the line of research I want to keep exploring.
Links
- Paper: HypeLoRA: Hyper-Network-Generated LoRA Adapters for Calibrated Language Model Fine-Tuning
- Code: HypeLoRA GitHub repository
Acknowledgments
I want to say thank you to my co-author Bartosz Trojan. I had really great time working as a part of your team and I am looking forward to working with you again.
Also I want to thank our mentors - Kamil Książek, PhD; Tomasz Kuśmierczyk, PhD; Jacek Tabor, Prof. Without their help, guidance and resources, that they provided us with, this resarch would not be possible.