spot_img
HomeResearch & DevelopmentPruneCD: Enhancing LLM Factuality Through Intelligent Layer Pruning

PruneCD: Enhancing LLM Factuality Through Intelligent Layer Pruning

TLDR: PruneCD is a new method that improves the factual accuracy of Large Language Models (LLMs) by using a technique called contrastive decoding. Unlike previous methods that used “early exit” predictions, PruneCD creates a more effective “amateur” model by selectively pruning specific layers of the LLM. This approach leads to more informative contrasts, resulting in significantly more truthful and reliable text generation with minimal impact on inference speed.

Large Language Models (LLMs) are incredibly powerful, but they sometimes “hallucinate,” meaning they generate fluent but factually incorrect information. This is a significant challenge, especially when these models are used for critical tasks. A new research paper introduces a method called PruneCD, which aims to make LLMs more truthful and reliable.

The core idea behind PruneCD builds on an existing technique called Contrastive Decoding (CD). CD works by comparing the confidence of an “expert” model (the full LLM) with an “amateur” model (a less capable version of the same LLM). The goal is to promote responses where the expert is confident, but the amateur is uncertain, thereby leading to more trustworthy outputs.

Previous approaches, like DoLa, created the amateur model by using “early exit” logits – predictions from earlier layers of the LLM. However, the researchers behind PruneCD found that these early exit predictions were often too flat and uninformative. They didn’t provide a meaningful contrast, limiting their effectiveness in improving factuality.

PruneCD addresses this limitation by constructing the amateur model through “layer pruning.” Instead of simply exiting early, PruneCD carefully removes a specific set of intermediate layers from the LLM. This results in an amateur model whose predictions are degraded enough to provide a contrast, but still informative and well-aligned with the expert model’s predictions. This “pruned” amateur model offers a much better signal for contrastive decoding.

The method involves a “Factual Layer Search via Ablation” process. This means identifying which layers are most crucial for encoding factual knowledge. The researchers systematically test removing individual layers and observe the impact on factuality scores. The layers that cause the biggest drop in factual accuracy when removed are then selected for pruning in the amateur model.

One of the key advantages of PruneCD is its efficiency. Both the expert and amateur model predictions can be computed simultaneously in a single forward pass using batched inference. This means PruneCD can improve factuality with minimal extra computational cost, offering decoding speeds comparable to standard greedy decoding.

The researchers conducted extensive experiments using various Llama family models (8B, 3B, and 1B sizes) and datasets like TruthfulQA, TriviaQA, Natural Questions, and StrategyQA. PruneCD consistently outperformed existing methods like DoLa, Activation Decoding, and END across nearly all tasks and model sizes. It showed significant improvements in truthfulness and informativeness, even for smaller models, which is crucial given the trend towards deploying more lightweight LLMs.

Beyond factual question answering, PruneCD also demonstrated strong performance on tasks requiring reasoning and instruction-following, such as GSM8K (math word problems) and VicunaQA. This indicates its broad applicability and robustness across different domains.

Also Read:

In summary, PruneCD offers a robust and practical solution to the hallucination problem in LLMs. By intelligently pruning layers to create a more effective amateur model for contrastive decoding, it significantly enhances the factuality and reliability of generated text without incurring substantial inference overhead. You can find more details about this innovative approach in the full research paper: PruneCD: Contrasting Pruned Self Model to Improve Decoding Factuality.

Meera Iyer
Meera Iyerhttps://blogs.edgentiq.com
Meera Iyer is an AI news editor who blends journalistic rigor with storytelling elegance. Formerly a content strategist in a leading tech firm, Meera now tracks the pulse of India's Generative AI scene, from policy updates to academic breakthroughs. She's particularly focused on bringing nuanced, balanced perspectives to the fast-evolving world of AI-powered tools and media. You can reach her out at: [email protected]

- Advertisement -

spot_img

Gen AI News and Updates

spot_img

- Advertisement -