# How AI Berkshire Implements the Contrarian Check (反共识检查) to Avoid Groupthink

> Discover how AI Berkshire uses a three-stage contrarian check (反共识检查) to prevent groupthink by actively seeking dissenting viewpoints and integrating opposing evidence into its research workflow.

- Repository: [Xbt Lin/ai-berkshire](https://github.com/xbtlin/ai-berkshire)
- Tags: how-to-guide
- Published: 2026-06-26

---

**AI Berkshire embeds a three-stage contrarian check (反共识检查) into its research workflow to deliberately surface dissenting viewpoints and prevent groupthink by mining multi-source consensus, explicitly prompting the LLM to find opposing evidence, and integrating findings under dedicated "反共识观点" headings.**

The **AI Berkshire** project (hosted at `xbtlin/ai-berkshire`) is an open-source investment research framework that mimics the analytical rigor of Berkshire Hathaway's decision-making process. At its core lies a **structured anti-bias mechanism** (结构化反偏见机制) designed to combat cognitive biases and consensus-driven errors. According to the project's README, the contrarian check represents one of five critical pillars of this system, systematically forcing analysts to question prevailing market narratives before finalizing any investment thesis.

## The Three-Stage Contrarian Check Implementation

The implementation of the **contrarian check** follows a tightly coupled, three-stage pipeline that transforms raw consensus data into actionable dissenting insights.

### Multi-Source Consensus Mining

Before generating any research output, the workflow mandates collecting **at least three independent sell-side research reports**. This requirement appears in the [`skills/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/deep-company-series.md) file, which governs the deep-dive research process. By gathering multiple independent sources, the system establishes a baseline "market consensus" while simultaneously creating the raw material necessary to identify contradictions and outliers.

As specified in [`skills/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/deep-company-series.md) (lines 100-104), researchers must analyze recent annual reports, quarterly filings, and critically, "阅读至少 3 份独立卖方研报（找共识 + 反共识）"—read at least 3 independent sell-side research reports to find both consensus and contrarian viewpoints.

### Explicit Contrarian Prompting

Once consensus data is extracted, the LLM receives a structured prompt engineered to force cognitive dissonance. The prompt explicitly instructs the model to perform the "**反共识检查**" and avoid echoing the market view. This prompting strategy requires the LLM to:

- List the consensus conclusions extracted from the collected reports
- Actively search for data points, arguments, or quantitative estimates that conflict with those conclusions
- Rank the identified contrarian arguments by credibility, citing the source of each dissenting claim

The prompt template typically follows this structure: "给定上述 [N] 条市场共识摘要，请执行反共识检查：找出所有与上述共识相冲突的公开信息、数据或分析，并给出来源。如果没有明显冲突，说明原因。" This explicit inversion prevents the model from defaulting to majority opinions.

### Result Integration and Review

The final stage integrates contrarian findings directly into research outputs under standardized headings. The system uses specific markdown sections labeled "**反共识观点**" (contrarian view) or "**反共识发现**" (contrarian discovery) to ensure dissenting analysis receives equal prominence with consensus views.

Real-world implementations appear throughout the repository's `reports/` directory. For example, in `reports/存储半导体/SK_Hynix_投资研究报告_20260512.md` (lines 71-73), a section titled "反共识发现" examines conflicting data regarding DRAM profit margins. Similarly, `reports/海尔智家-deepseek分析/03-行业竞争分析-芒格视角.md` (lines 167-168) contains a "反共识观点" section that challenges prevailing industry assumptions about competitive dynamics.

## Code Implementation and Workflow Integration

While the repository primarily contains markdown-based skills and research outputs, the contrarian check logic follows a consistent programmatic pattern. Below is representative pseudo-code illustrating how the check is invoked within the research pipeline:

```python

# pseudo-code: contrarian_check.py

def contrarian_check(company: str, consensus_reports: List[str]) -> List[dict]:
    """
    1️⃣ Extract consensus statements from each report.
    2️⃣ Prompt Claude (or the configured LLM) to find opposing evidence.
    3️⃣ Return a list of contrarian insights with source attribution.
    """
    consensus = extract_consensus(consensus_reports)          # custom parser

    prompt = f"""
    下面是对 {company} 的 {len(consensus)} 条市场共识摘要：
    {format_consensus(consensus)}

    请执行 **反共识检查**：找出所有与上述共识相冲突的公开信息、数据或分析，
    并给出来源（报告、财报、行业数据等）。如果没有明显冲突，说明原因。
    """
    response = llm.generate(prompt)                          # Claude call

    return parse_contrarian_response(response)

```

This function integrates into the broader workflow defined in [`skills/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/deep-company-series.md) (lines 98-104):

```markdown

### 2. 调研阶段（deep-company-series skill）

1. 阅读公司近 5 年年报、最新季报。
2. **阅读至少 3 份独立卖方研报（找共识 + 反共识）** → 调用 `contrarian_check.py`。
3. 用 `/investment-research` 生成内部底稿，随后在报告中加入：

> **反共识观点**
> - …（来自报告 X 的冲突论点）
> - …（来自报告 Y 的数据差异）
> ...

```

## Real-World Examples in Research Reports

The AI Berkshire framework generates concrete deliverables that demonstrate the contrarian check in action. Two exemplar files illustrate the output format:

- **`reports/存储半导体/SK_Hynix_投资研究报告_20260512.md`** (lines 71-73): Contains a "反共识发现" section analyzing DRAM profit margin assumptions that contradict mainstream analyst projections
- **`reports/海尔智家-deepseek分析/03-行业竞争分析-芒格视角.md`** (lines 167-168): Features a "反共识观点" section challenging consensus views on competitive positioning within the smart home appliance sector

These sections follow a standardized format: they cite the specific consensus claim being challenged, present the conflicting evidence or alternative interpretation, and attribute the dissenting view to its original source—whether a contrarian analyst report, primary financial data, or industry statistics.

## Summary

- **AI Berkshire's contrarian check** is one of five pillars in the project's structured anti-bias mechanism, designed to prevent groupthink in investment research
- **Implementation requires three inputs**: at least three independent sell-side reports, explicit LLM prompting to invert consensus views, and dedicated markdown sections for contrarian findings
- **Key source files** include [`README.md`](https://github.com/xbtlin/ai-berkshire/blob/main/README.md) (lines 92-94) for the framework overview, [`skills/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/deep-company-series.md) (lines 100-104) for workflow requirements, and specific report files in `reports/` demonstrating output formats
- **The check surfaces hidden risks** by forcing systematic examination of viewpoints that conflict with prevailing market narratives, documented under standardized headings like "反共识观点" and "反共识发现"

## Frequently Asked Questions

### What triggers the contrarian check in AI Berkshire's workflow?

The contrarian check triggers during the **research phase** of the deep-company-series skill, specifically after the analyst (or LLM) has gathered at least three independent sell-side research reports. According to [`skills/deep-company-series.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/deep-company-series.md), the check is mandatory before generating the internal investment research draft, ensuring that consensus gathering is always paired with consensus challenging.

### How does the contrarian check differ from simple devil's advocacy?

Unlike generic devil's advocacy, the **反共识检查** requires specific structural components: (1) extraction and documentation of the actual consensus from multiple sources, (2) ranked credibility assessment of dissenting claims with explicit source attribution, and (3) dedicated output sections labeled "反共识观点" or "反共识发现". This prevents the check from becoming performative opposition and ensures substantive conflict with actual market views rather than hypothetical counterarguments.

### Can the contrarian check be implemented with LLMs other than Claude?

Yes. While the repository examples reference Claude, the `contrarian_check()` function abstracts the LLM interaction through a generic `llm.generate()` interface. The critical component is the structured prompt template that forces the model to list consensus points, identify conflicts, and rank alternatives—this prompting strategy is model-agnostic and works with GPT-4, Gemini, or other capable language models.

### Where does AI Berkshire document the results of the contrarian check?

Results appear in dedicated markdown sections within final research reports. The repository uses standardized headings: "**反共识观点**" for general contrarian viewpoints and "**反共识发现**" for specific data-driven discoveries. These sections appear in files like `SK_Hynix_投资研究报告_20260512.md` and `海尔智家-deepseek分析/03-行业竞争分析-芒格视角.md`, ensuring that dissenting analysis remains visible in the final investment thesis rather than being relegated to appendices or footnotes.