SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.03425 · 2024

Gaussian Stochastic Weight Averaging for Bayesian Low-Rank Adaptation of Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 7 functions out of this paper's own repositories and ran 4 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
fortuinlab/swag-lora canonical 4 of 7
FunctionStatusWhere it lives
compute_nll Ran fortuinlab/swag-lora/utils/eval_utils.py
code served (permissive licence) · get_code("639d998673661691")
flatten Ran fortuinlab/swag-lora/SWAG.py
code served (permissive licence) · get_code("cdc64e98aaf2dd54")
mean_logits Ran fortuinlab/swag-lora/utils/eval_utils.py
code served (permissive licence) · get_code("db7ed1c792d13d1e")
mean_preds Ran fortuinlab/swag-lora/utils/eval_utils.py
code served (permissive licence) · get_code("ec4d2d63dcda42f8")
load_glue_data Not yet run fortuinlab/swag-lora/data.py
code served (permissive licence) · get_code("f39e3b94583b1970")
load_mcqa_data Not yet run fortuinlab/swag-lora/data.py
code served (permissive licence) · get_code("eeee5555e68e0771")
unflatten_like Not yet run fortuinlab/swag-lora/SWAG.py
code served (permissive licence) · get_code("2da33912415648f3")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Fine-tuned Large Language Models (LLMs) often suffer from overconfidence and poor calibration, particularly when fine-tuned on small datasets. To address these challenges, we propose a simple combination of Low-Rank Adaptation (LoRA) with Gaussian Stochastic Weight Averaging (SWAG), facilitating approximate Bayesian inference in LLMs. Through extensive testing across several Natural Language Processing (NLP) benchmarks, we demonstrate that our straightforward and computationally efficient approach improves model generalization and calibration competitively with comparable, more sophisticated methods for Bayesian inference in LLMs. We further show that our method exhibits greater robustness against distribution shift, as reflected in its improved performance on out-of-distribution tasks.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2405.03425")
get_code_for_paper("2405.03425")
have("2405.03425")

Connect an agent — have() is free.