[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-google-research--bigbird":3,"similar-google-research--bigbird":88},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":8,"readme_en":9,"readme_zh":10,"quickstart_zh":11,"use_case_zh":12,"hero_image_url":13,"owner_login":14,"owner_name":15,"owner_avatar_url":16,"owner_bio":17,"owner_company":18,"owner_location":18,"owner_email":18,"owner_twitter":18,"owner_website":19,"owner_url":20,"languages":21,"stars":34,"forks":35,"last_commit_at":36,"license":37,"difficulty_score":38,"env_os":39,"env_gpu":40,"env_ram":41,"env_deps":42,"category_tags":48,"github_topics":51,"view_count":57,"oss_zip_url":18,"oss_zip_packed_at":18,"status":58,"created_at":59,"updated_at":60,"faqs":61,"releases":87},6651,"google-research\u002Fbigbird","bigbird","Transformers for Longer Sequences","Big Bird 是一款基于稀疏注意力机制的 Transformer 模型，专为处理超长文本序列而设计。传统模型如 BERT 受限于计算资源，难以有效处理长上下文，而 Big Bird 通过创新的注意力结构突破了这一瓶颈，使模型能够理解更长的文档内容。\n\n这一特性让 Big Bird 在问答系统、长文档摘要等自然语言处理任务中表现卓越，显著提升了准确率与效果。其核心优势在于理论证明了稀疏注意力机制可以媲美完整 Transformer 的能力，同时大幅降低计算复杂度。\n\nBig Bird 特别适合 AI 研究人员、NLP 开发者以及需要处理长篇文本数据的技术团队使用。项目提供了完整的代码实现，包括注意力机制、编码器栈及预训练模型，并支持在 Google Cloud TPU 上高效运行。此外，官方还发布了基于 BERT 和 Pegasus 架构的预训练检查点，方便用户直接微调应用于分类、生成等具体场景。\n\n作为谷歌研究团队开源的成果，Big Bird 不仅推动了长序列建模的技术边界，也为实际工业应用提供了可靠方案。无论是学术探索还是工程落地，它都是处理长文本任务的有力工具。","# Big Bird: Transformers for Longer Sequences\n\nNot an official Google product.\n\n# What is BigBird?\nBigBird, is a sparse-attention based transformer which extends Transformer based models, such as BERT to much longer sequences. Moreover, BigBird comes along with a theoretical understanding of the capabilities of a complete transformer that the sparse model can handle.\n\nAs a consequence of the capability to handle longer context,\nBigBird drastically improves performance on various NLP tasks such as question answering and summarization.\n\nMore details and comparisons can be found in our [presentation](https:\u002F\u002Fdocs.google.com\u002Fpresentation\u002Fd\u002F1FdMNqG2b8XYc89_v7-_2sba7Iz6YAlXXWuMxUbrKFK0\u002Fpreview?resourcekey=0-KHcdpCx83g7a2JNz0h0-6w).\n\n\n# Citation\nIf you find this useful, please cite our [NeurIPS 2020 paper](https:\u002F\u002Fpapers.nips.cc\u002Fpaper\u002F2020\u002Fhash\u002Fc8512d142a2d849725f31a9a7a361ab9-Abstract.html):\n```\n@article{zaheer2020bigbird,\n  title={Big bird: Transformers for longer sequences},\n  author={Zaheer, Manzil and Guruganesh, Guru and Dubey, Kumar Avinava and Ainslie, Joshua and Alberti, Chris and Ontanon, Santiago and Pham, Philip and Ravula, Anirudh and Wang, Qifan and Yang, Li and others},\n  journal={Advances in Neural Information Processing Systems},\n  volume={33},\n  year={2020}\n}\n```\n\n\n# Code\n\nThe most important directory is `core`.\nThere are three main files in `core`.\n\n*   [attention.py](bigbird\u002Fcore\u002Fattention.py):\n    Contains BigBird linear attention mechanism\n*   [encoder.py](bigbird\u002Fcore\u002Fencoder.py):\n    Contains the main long sequence encoder stack\n*   [modeling.py](bigbird\u002Fcore\u002Fmodeling.py):\n    Contains packaged BERT and seq2seq transformer models with BigBird attention\n\n\n### Colab\u002FIPython Notebook\n\nA quick fine-tuning demonstration for text classification is provided in\n[imdb.ipynb](bigbird\u002Fclassifier\u002Fimdb.ipynb)\n\n\n### Create GCP Instance\nPlease create a project first and create an instance in a zone which has quota as follows\n\n```bash\ngcloud compute instances create \\\n  bigbird \\\n  --zone=europe-west4-a \\\n  --machine-type=n1-standard-16 \\\n  --boot-disk-size=50GB \\\n  --image-project=ml-images \\\n  --image-family=tf-2-3-1 \\\n  --maintenance-policy TERMINATE \\\n  --restart-on-failure \\\n  --scopes=cloud-platform\n\ngcloud compute tpus create \\\n  bigbird \\\n  --zone=europe-west4-a \\\n  --accelerator-type=v3-32 \\\n  --version=2.3.1\n\ngcloud compute ssh --zone \"europe-west4-a\" \"bigbird\"\n\n```\n\nFor illustration we used instance name `bigbird` and zone `europe-west4-a`, but feel free to change them.\nMore details about creating Google Cloud TPU can be found in [online documentations](https:\u002F\u002Fcloud.google.com\u002Ftpu\u002Fdocs\u002Fcreating-deleting-tpus#setup_TPU_only).\n\n\n### Instalation and checkpoints\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fbigbird.git\ncd bigbird\npip3 install -e .\n```\nYou can find pretrained and fine-tuned checkpoints in our [Google Cloud Storage Bucket](https:\u002F\u002Fconsole.cloud.google.com\u002Fstorage\u002Fbrowser\u002Fbigbird-transformer).\n\nOptionally, you can download them using `gsutil` as\n```bash\nmkdir -p bigbird\u002Fckpt\ngsutil cp -r gs:\u002F\u002Fbigbird-transformer\u002F bigbird\u002Fckpt\u002F\n```\n\nThe storage bucket contains:\n- pretrained BERT model for base(`bigbr_base`) and large (`bigbr_large`) size. It correspond to BERT\u002FRoBERTa-like encoder only models. Following original BERT and RoBERTa implementation they are transformers with post-normalization, i.e. layer norm is happening after the attention layer. However, following [Rothe et al](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.12461), we can use them partially in encoder-decoder fashion by coupling the encoder and decoder parameters, as illustrated in [bigbird\u002Fsummarization\u002Froberta_base.sh](bigbird\u002Fsummarization\u002Froberta_base.sh) launch script.\n- pretrained Pegasus Encoder-Decoder Transformer in large size(`bigbp_large`). Again following original implementation of Pegasus, they are transformers with pre-normalization. They have full set of separate encoder-decoder weights. Also for long document summarization datasets, we have converted Pegasus checkpoints (`model.ckpt-0`) for each dataset and also provided fine-tuned checkpoints (`model.ckpt-300000`) which works on longer documents.\n- fine-tuned `tf.SavedModel` for long document summarization which can be directly be used for prediction and evaluation as illustrated in the [colab nootebook](bigbird\u002Fsummarization\u002Feval.ipynb).\n\n\n### Running Classification\n\nFor quickly starting with BigBird, one can start by running the classification experiment code in `classifier` directory.\nTo run the code simply execute\n\n```shell\nexport GCP_PROJECT_NAME=bigbird-project  # Replace by your project name\nexport GCP_EXP_BUCKET=gs:\u002F\u002Fbigbird-transformer-training\u002F  # Replace\nsh -x bigbird\u002Fclassifier\u002Fbase_size.sh\n```\n\n\n## Using BigBird Encoder instead BERT\u002FRoBERTa\n\nTo directly use the encoder instead of say BERT model, we can use the following\ncode.\n\n```python\nfrom bigbird.core import modeling\n\nbigb_encoder = modeling.BertModel(...)\n```\n\nIt can easily replace [BERT's](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.04805) encoder.\n\n\nAlternatively, one can also try playing with layers of BigBird encoder\n\n```python\nfrom bigbird.core import encoder\n\nonly_layers = encoder.EncoderStack(...)\n```\n\n\n## Understanding Flags & Config\n\nAll the flags and config are explained in\n`core\u002Fflags.py`. Here we explain\nsome of the important config paramaters.\n\n`attention_type` is used to select the type of attention we would use. Setting\nit to `block_sparse` runs the BigBird attention module.\n\n```python\nflags.DEFINE_enum(\n    \"attention_type\", \"block_sparse\",\n    [\"original_full\", \"simulated_sparse\", \"block_sparse\"],\n    \"Selecting attention implementation. \"\n    \"'original_full': full attention from original bert. \"\n    \"'simulated_sparse': simulated sparse attention. \"\n    \"'block_sparse': blocked implementation of sparse attention.\")\n```\n\n`block_size` is used to define the size of blocks, whereas `num_rand_blocks` is\nused to set the number of random blocks. The code currently uses window size of\n3 blocks and 2 global blocks. The current code only supports static tensors.\n\nImportant points to note:\n* Hidden dimension should be divisible by the number of heads.\n* Currently the code only handles tensors of static shape as it is primarily designed\nfor TPUs which only works with statically shaped tensors.\n* For sequene length less than 1024, using `original_full` is advised as there\nis no benefit in using sparse BigBird attention.\n\n## Comparisons\nRecently, [Long Range Arena](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2011.04006.pdf) provided a benchmark of six tasks that require longer context, and performed experiments to benchmark all existing long range transformers. The results are shown below. BigBird model, unlike its counterparts, clearly reduces memory consumption without sacrificing performance.\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-research_bigbird_readme_d511073bab3f.png\" width=\"50%\">\n","# 大鸟：适用于更长序列的Transformer\n\n非 Google 官方产品。\n\n# 什么是 BigBird？\nBigBird 是一种基于稀疏注意力机制的 Transformer 模型，它将 BERT 等基于 Transformer 的模型扩展到处理更长的序列。此外，BigBird 还提供了对完整 Transformer 能力的理论理解，说明稀疏模型能够处理的能力范围。\n\n由于能够处理更长的上下文，BigBird 在问答和摘要等多种自然语言处理任务上显著提升了性能。\n\n更多详细信息和对比结果，请参阅我们的 [演示文稿](https:\u002F\u002Fdocs.google.com\u002Fpresentation\u002Fd\u002F1FdMNqG2b8XYc89_v7-_2sba7Iz6YAlXXWuMxUbrKFK0\u002Fpreview?resourcekey=0-KHcdpCx83g7a2JNz0h0-6w)。\n\n# 引用\n如果您觉得本项目有用，请引用我们的 [NeurIPS 2020 论文](https:\u002F\u002Fpapers.nips.cc\u002Fpaper\u002F2020\u002Fhash\u002Fc8512d142a2d849725f31a9a7a361ab9-Abstract.html)：\n```\n@article{zaheer2020bigbird,\n  title={Big bird: Transformers for longer sequences},\n  author={Zaheer, Manzil and Guruganesh, Guru and Dubey, Kumar Avinava and Ainslie, Joshua and Alberti, Chris and Ontanon, Santiago and Pham, Philip and Ravula, Anirudh and Wang, Qifan and Yang, Li and others},\n  journal={Advances in Neural Information Processing Systems},\n  volume={33},\n  year={2020}\n}\n```\n\n\n# 代码\n\n最重要的目录是 `core`。`core` 目录下有三个主要文件：\n\n*   [attention.py](bigbird\u002Fcore\u002Fattention.py)：\n    包含 BigBird 的线性注意力机制\n*   [encoder.py](bigbird\u002Fcore\u002Fencoder.py)：\n    包含主要的长序列编码器堆栈\n*   [modeling.py](bigbird\u002Fcore\u002Fmodeling.py)：\n    包含封装了 BigBird 注意力机制的 BERT 和 seq2seq Transformer 模型\n\n\n### Colab\u002FIPython 笔记本\n\n在 [imdb.ipynb](bigbird\u002Fclassifier\u002Fimdb.ipynb) 中提供了一个用于文本分类的快速微调示例。\n\n\n### 创建 GCP 实例\n请先创建一个项目，并在具有以下配额的区域中创建实例：\n\n```bash\ngcloud compute instances create \\\n  bigbird \\\n  --zone=europe-west4-a \\\n  --machine-type=n1-standard-16 \\\n  --boot-disk-size=50GB \\\n  --image-project=ml-images \\\n  --image-family=tf-2-3-1 \\\n  --maintenance-policy TERMINATE \\\n  --restart-on-failure \\\n  --scopes=cloud-platform\n\ngcloud compute tpus create \\\n  bigbird \\\n  --zone=europe-west4-a \\\n  --accelerator-type=v3-32 \\\n  --version=2.3.1\n\ngcloud compute ssh --zone \"europe-west4-a\" \"bigbird\"\n\n```\n\n为了便于说明，我们使用了实例名称 `bigbird` 和区域 `europe-west4-a`，但您可以根据需要进行更改。有关创建 Google Cloud TPU 的更多详细信息，请参阅 [在线文档](https:\u002F\u002Fcloud.google.com\u002Ftpu\u002Fdocs\u002Fcreating-deleting-tpus#setup_TPU_only)。\n\n### 安装与检查点\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fbigbird.git\ncd bigbird\npip3 install -e .\n```\n您可以在我们的 [Google Cloud Storage 存储桶](https:\u002F\u002Fconsole.cloud.google.com\u002Fstorage\u002Fbrowser\u002Fbigbird-transformer)中找到预训练和微调后的检查点。\n\n您也可以使用 `gsutil` 下载它们：\n```bash\nmkdir -p bigbird\u002Fckpt\ngsutil cp -r gs:\u002F\u002Fbigbird-transformer\u002F bigbird\u002Fckpt\u002F\n```\n\n该存储桶包含：\n- 预训练的 BERT 模型，分为 base（`bigbr_base`）和 large（`bigbr_large`）两种尺寸。这些模型仅对应于类似 BERT\u002FRoBERTa 的编码器部分。遵循原始 BERT 和 RoBERTa 的实现，它们采用后归一化结构，即层归一化发生在注意力层之后。然而，根据 [Rothe 等人](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.12461)的研究，我们可以通过耦合编码器和解码器参数，将其部分地以编码器-解码器的方式使用，如 [bigbird\u002Fsummarization\u002Froberta_base.sh](bigbird\u002Fsummarization\u002Froberta_base.sh) 启动脚本所示。\n- 预训练的 Pegasus 编码器-解码器 Transformer，large 尺寸（`bigbp_large`）。同样遵循 Pegasus 的原始实现，这些模型采用前归一化结构，拥有完整的独立编码器和解码器权重。此外，针对长文档摘要数据集，我们还为每个数据集转换了 Pegasus 检查点（`model.ckpt-0`），并提供了适用于更长文档的微调检查点（`model.ckpt-300000`）。\n- 微调后的 `tf.SavedModel` 用于长文档摘要，可以直接用于预测和评估，如 [colab 笔记本](bigbird\u002Fsummarization\u002Feval.ipynb) 所示。\n\n\n### 运行分类任务\n要快速开始使用 BigBird，可以从 `classifier` 目录中的分类实验代码入手。运行代码只需执行以下命令：\n\n```shell\nexport GCP_PROJECT_NAME=bigbird-project  # 替换为您自己的项目名称\nexport GCP_EXP_BUCKET=gs:\u002F\u002Fbigbird-transformer-training\u002F  # 替换\nsh -x bigbird\u002Fclassifier\u002Fbase_size.sh\n```\n\n\n## 使用 BigBird 编码器代替 BERT\u002FRoBERTa\n\n要直接使用编码器而不是例如 BERT 模型，可以使用以下代码：\n\n```python\nfrom bigbird.core import modeling\n\nbigb_encoder = modeling.BertModel(...)\n```\n\n它可以轻松替代 [BERT](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.04805) 的编码器。\n\n或者，您也可以尝试操作 BigBird 编码器的各个层：\n\n```python\nfrom bigbird.core import encoder\n\nonly_layers = encoder.EncoderStack(...)\n```\n\n\n## 标志与配置说明\n所有标志和配置都在 `core\u002Fflags.py` 中进行了说明。以下是一些重要的配置参数：\n\n`attention_type` 用于选择使用的注意力类型。将其设置为 `block_sparse` 可以运行 BigBird 的注意力模块。\n\n```python\nflags.DEFINE_enum(\n    \"attention_type\", \"block_sparse\",\n    [\"original_full\", \"simulated_sparse\", \"block_sparse\"],\n    \"选择注意力实现方式。\"\n    \"'original_full'：原始 BERT 的全注意力机制。\"\n    \"'simulated_sparse'：模拟的稀疏注意力机制。\"\n    \"'block_sparse'：稀疏注意力的分块实现。\")\n```\n\n`block_size` 用于定义块的大小，而 `num_rand_blocks` 则用于设置随机块的数量。当前代码使用 3 个窗口块和 2 个全局块。目前代码仅支持静态张量。\n\n需要注意的要点：\n* 隐藏层维度必须能被头数整除。\n* 当前代码仅处理静态形状的张量，因为它主要是为 TPU 设计的，而 TPU 只能处理静态形状的张量。\n* 对于序列长度小于 1024 的情况，建议使用 `original_full`，因为此时使用稀疏的 BigBird 注意力并无优势。\n\n## 对比\n最近，[Long Range Arena](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2011.04006.pdf) 提供了一个包含六个需要较长上下文的任务的基准测试，并对现有的所有长距离 Transformer 模型进行了实验比较。结果如下所示。与其他模型相比，BigBird 模型在不牺牲性能的情况下显著降低了内存消耗。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-research_bigbird_readme_d511073bab3f.png\" width=\"50%\">","# Big Bird 快速上手指南\n\nBig Bird 是一种基于稀疏注意力机制的 Transformer 模型，旨在将 BERT 等模型扩展至处理更长的序列（Longer Sequences）。它在问答、摘要等需要长上下文的 NLP 任务中表现卓越。\n\n## 环境准备\n\n*   **系统要求**：推荐在 Linux 环境下运行。\n*   **硬件加速**：官方代码主要针对 **Google Cloud TPU** 优化（需静态形状张量），但也支持 GPU\u002FCPU 运行（需注意显存限制）。\n*   **前置依赖**：\n    *   Python 3.x\n    *   TensorFlow 2.3.1+ (官方示例基于此版本)\n    *   `git`, `pip`\n    *   (可选) Google Cloud SDK (`gcloud`, `gsutil`)：如需使用官方提供的预训练权重或 TPU 实例。\n\n> **注意**：由于该工具由 Google Research 发布且强依赖 GCP 生态，国内用户若无 GCP 环境，建议在本地安装 TensorFlow 后尝试运行分类示例，但下载预训练模型可能需要配置网络代理或使用镜像加速。\n\n## 安装步骤\n\n### 1. 克隆代码库\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fbigbird.git\ncd bigbird\n```\n\n### 2. 安装依赖包\n使用可编辑模式安装，以便直接修改核心代码：\n```bash\npip3 install -e .\n```\n\n### 3. 获取预训练模型（可选）\n官方权重存储在 Google Cloud Storage。如果您已配置好 `gsutil` 且有访问权限，可执行以下命令下载：\n\n```bash\nmkdir -p bigbird\u002Fckpt\ngsutil cp -r gs:\u002F\u002Fbigbird-transformer\u002F bigbird\u002Fckpt\u002F\n```\n*包含内容*：\n*   `bigbr_base` \u002F `bigbr_large`: 类 BERT\u002FRoBERTa 的编码器模型。\n*   `bigbp_large`: 类 Pegasus 的 Encoder-Decoder 模型（适用于长文档摘要）。\n*   针对特定数据集微调后的检查点。\n\n## 基本使用\n\n### 方式一：运行文本分类示例（推荐起步）\n仓库提供了一个基于 IMDB 数据集的微调演示，位于 `classifier` 目录。\n\n1.  设置环境变量（请替换为您自己的 GCP 项目名称和存储桶路径，若仅在本地测试可暂时忽略或设为本地路径）：\n    ```shell\n    export GCP_PROJECT_NAME=bigbird-project\n    export GCP_EXP_BUCKET=gs:\u002F\u002Fbigbird-transformer-training\u002F\n    ```\n\n2.  执行基础尺寸模型的训练脚本：\n    ```shell\n    sh -x bigbird\u002Fclassifier\u002Fbase_size.sh\n    ```\n\n### 方式二：在代码中直接调用 Encoder\n您可以直接将 Big Bird Encoder 作为 BERT 的替代品嵌入到您的项目中。\n\n**替换 BERT 编码器：**\n```python\nfrom bigbird.core import modeling\n\n# 初始化 Big Bird BERT 模型\n# 参数配置需根据具体任务调整，此处省略具体参数\nbigb_encoder = modeling.BertModel(...)\n```\n\n**仅使用编码器堆栈（底层调用）：**\n```python\nfrom bigbird.core import encoder\n\n# 直接使用 EncoderStack\nonly_layers = encoder.EncoderStack(...)\n```\n\n### 关键配置说明\n在运行模型时，需通过 flags 配置注意力机制类型。核心参数如下：\n\n*   `attention_type`: 选择注意力实现方式。\n    *   `\"block_sparse\"`: **Big Bird 核心模式**，启用块稀疏注意力。\n    *   `\"original_full\"`: 原始 BERT 的全量注意力（序列长度 \u003C 1024 时建议使用此项，稀疏模式无优势）。\n    *   `\"simulated_sparse\"`: 模拟稀疏注意力。\n\n*   `block_size`: 定义块的大小。\n*   `num_rand_blocks`: 设置随机块的数量。\n\n**示例配置逻辑（参考 `core\u002Fflags.py`）：**\n```python\n# 伪代码示例，实际运行通常通过命令行参数传递\n# --attention_type=block_sparse\n```\n\n> **提示**：当前代码主要设计用于 TPU，要求张量形状静态固定。隐藏维度（Hidden dimension）必须能被注意力头数（Number of heads）整除。","某法律科技团队正在构建一个智能合同审查系统，需要让 AI 自动分析长达数十页的法律文档并提取关键风险条款。\n\n### 没有 bigbird 时\n- **上下文截断严重**：传统 BERT 模型仅支持 512 个 token，迫使团队将完整合同强行切分为碎片，导致跨段落的逻辑关联（如“定义”与“违约责任”的呼应）完全丢失。\n- **关键信息遗漏**：由于无法纵观全文，模型经常忽略出现在文档开头但在结尾才被引用的关键限制条件，造成风险评估准确率低下。\n- **工程复杂度高**：开发人员不得不编写复杂的启发式规则来拼接碎片化的预测结果，不仅增加了维护成本，还引入了大量人为错误。\n\n### 使用 bigbird 后\n- **超长序列原生支持**：bigbird 利用稀疏注意力机制轻松处理数千甚至上万个 token，能够一次性将整个合同文档输入模型，完整保留文档的全局结构。\n- **全局理解能力提升**：模型可以直接捕捉文档首尾之间的长距离依赖关系，精准识别出分散在不同章节的风险条款，显著提高了问答和摘要任务的性能。\n- **架构简化高效**：团队移除了繁琐的文本切片与后处理逻辑，直接基于 bigbird 的微调模型进行端到端推理，开发效率大幅提升且推理结果更加连贯可靠。\n\nbigbird 通过突破 Transformer 的长度限制，让 AI 真正具备了像人类专家一样通读并理解长篇专业文档的核心能力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-research_bigbird_3926d453.png","google-research","Google Research","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fgoogle-research_c23b2adf.png","",null,"https:\u002F\u002Fresearch.google","https:\u002F\u002Fgithub.com\u002Fgoogle-research",[22,26,30],{"name":23,"color":24,"percentage":25},"Python","#3572A5",74.6,{"name":27,"color":28,"percentage":29},"Jupyter Notebook","#DA5B0B",24.5,{"name":31,"color":32,"percentage":33},"Shell","#89e051",0.9,633,109,"2026-03-19T20:09:12","Apache-2.0",4,"Linux","未说明 (主要依赖 Google Cloud TPU v3-32，未提供本地 GPU 具体型号要求)","未说明 (示例配置使用 n1-standard-16，即 60GB RAM)",{"notes":43,"python":44,"dependencies":45},"该工具主要针对 Google Cloud TPU 环境设计，代码仅支持静态形状张量。官方示例基于 TensorFlow 2.3.1 和 TPU v3-32。对于长度小于 1024 的序列，建议使用原始全注意力机制而非 BigBird 稀疏注意力。预训练模型存储在 Google Cloud Storage 中，需使用 gsutil 下载。","3.x (通过 pip3 安装)",[46,47],"TensorFlow 2.3.1","gsutil",[49,50],"语言模型","开发框架",[52,53,54,55,56],"transformer","bert","nlp","longer-sequences","deep-learning",2,"ready","2026-03-27T02:49:30.150509","2026-04-11T23:22:52.782178",[62,67,72,77,82],{"id":63,"question_zh":64,"answer_zh":65,"source_url":66},30031,"BigBird 的预训练权重（bigbr_large, bigbr_base, bigbp_large）分别对应什么模型架构？","- `bigbr_large` 和 `bigbr_base` 对应类似 BERT\u002FRoBERTa 的仅编码器（encoder-only）模型。遵循原始实现，它们采用后归一化（post-normalization），即层归一化发生在注意力层之后。但也可以参考 Rothe 等人的方法，通过耦合编码器和解码器参数，将它们部分用于编码器 - 解码器模式（参见 `bigbird\u002Fsummarization\u002Froberta_base.sh` 启动脚本）。\n- `bigbp_large` 是类似 Pegasus 的编码器 - 解码器（encoder-decoder）模型。遵循 Pegasus 原始实现，它们采用前归一化（pre-normalization），并拥有完全独立的编码器和解码器权重集。","https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fbigbird\u002Fissues\u002F1",{"id":68,"question_zh":69,"answer_zh":70,"source_url":71},30032,"如何使用 TFRecord 文件微调 BigBird 模型时解决\"Feature: document is required but could not be found\"错误？","该错误通常是因为代码中定义的字段名称与 TFRecord 文件中的实际字段名称不匹配。解决方法是将代码中的 `name_to_features` 字典键值替换为 TFRecord 文件中实际存在的字段名称（例如将 'document' 改为你数据集中实际的文本字段名）。","https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fbigbird\u002Fissues\u002F19",{"id":73,"question_zh":74,"answer_zh":75,"source_url":76},30033,"如何训练其他语言版本的 BigBird 模型？","可以使用项目中提供的预训练代码进行训练，代码位于 `bigbird\u002Fpretrain\u002F` 目录下。该代码支持训练掩码语言模型（Masked LM）。针对特定语言，你需要准备该语言专用的词汇表（vocabulary），然后利用提供的脚本进行训练。","https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fbigbird\u002Fissues\u002F5",{"id":78,"question_zh":79,"answer_zh":80,"source_url":81},30034,"BigBird 在 TriviaQA 数据集上的预处理方式与 Longformer 相同吗？","是的，预处理代码与 Longformer 非常相似。主要改进在于字符串匹配算法的实现，并将较大的文档分割成大小为 4096 的块。具体的预处理代码作为 Beam 管道实现，可在 TensorFlow Models 仓库的 `official\u002Fnlp\u002Fprojects\u002Ftriviaqa\u002Fdataset.py` 中找到。","https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fbigbird\u002Fissues\u002F4",{"id":83,"question_zh":84,"answer_zh":85,"source_url":86},30035,"使用自定义 TFDS 数据集运行 BigBird 分类任务时无输出或报错，如何解决？","这通常是由于 TFDS 指向了错误的数据集路径（例如指向了主目录而不是虚拟环境目录）导致的。建议检查 `create_new_datasets.py` 配置，或者尝试卸载并重新安装 `tensorflow_datasets` 包，确保其安装在当前使用的虚拟环境中，以修正路径指向问题。","https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fbigbird\u002Fissues\u002F27",[],[89,101,109,117,125,134],{"id":90,"name":91,"github_repo":92,"description_zh":93,"stars":94,"difficulty_score":95,"last_commit_at":96,"category_tags":97,"status":58},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[98,50,99,100],"Agent","图像","数据工具",{"id":102,"name":103,"github_repo":104,"description_zh":105,"stars":106,"difficulty_score":95,"last_commit_at":107,"category_tags":108,"status":58},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[50,99,98],{"id":110,"name":111,"github_repo":112,"description_zh":113,"stars":114,"difficulty_score":57,"last_commit_at":115,"category_tags":116,"status":58},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",150720,"2026-04-11T11:33:10",[50,98,49],{"id":118,"name":119,"github_repo":120,"description_zh":121,"stars":122,"difficulty_score":57,"last_commit_at":123,"category_tags":124,"status":58},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[50,99,98],{"id":126,"name":127,"github_repo":128,"description_zh":129,"stars":130,"difficulty_score":57,"last_commit_at":131,"category_tags":132,"status":58},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[133,98,99,50],"插件",{"id":135,"name":136,"github_repo":137,"description_zh":138,"stars":139,"difficulty_score":57,"last_commit_at":140,"category_tags":141,"status":58},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[133,50]]