Skip to content

Latest commit

 

History

History
94 lines (73 loc) · 3.13 KB

File metadata and controls

94 lines (73 loc) · 3.13 KB

Baseline运行状态报告

1. 当前状态

✅ Baseline确实使用向量数据库

代码位置rag_base/rag_complete.py:251-263

# Baseline RAG (search_method=0) 不需要abstract相关的处理
if search_method == 0 or forest is None:
    # 对于baseline RAG,直接使用向量数据库检索的结果,只取top k
    results = results[:k]
    # 记录Baseline的检索时间(向量数据库检索完成到结果处理完成的时间)
    baseline_retrieval_end = time.time()
    retrieval_time = baseline_retrieval_end - start_time

Baseline RAG工作流程

  1. Query → 实体识别(不使用)
  2. Query Embedding → 向量数据库搜索 db.search(table_name, input_embedding, k * 3)
  3. 取top k个chunks
  4. 组合成context发送给LLM

特点

  • 使用向量数据库:直接通过向量相似度搜索
  • 不使用Entity识别:不依赖实体
  • 不使用Abstract:不利用层次结构
  • 不使用Cuckoo Filter:最简单的RAG方法

2. 新Prompt的Baseline运行状态

❌ 新Prompt的Baseline尚未完成

检查结果

  • ✅ 找到了日志文件(但为空):
    • medqa_baseline_new_prompt_100.log (0 bytes)
    • dart_baseline_new_prompt_100.log (0 bytes)
    • triviaqa_baseline_new_prompt_100.log (0 bytes)
  • 未找到JSON结果文件
  • 未找到评估文件

之前的Baseline结果

已完成的Baseline结果(使用旧prompt):

  • medqa_baseline_depth2_100_evaluation.json
    • BLEU: 0.0064
    • ROUGE-L: N/A
    • BERTScore: N/A
  • dart_baseline_depth2_100_evaluation.json
    • BLEU: 0.2222
    • ROUGE-L: N/A
    • BERTScore: N/A
  • triviaqa_baseline_depth2_100.json
    • 已完成: 100/100
    • 平均检索时间: 5.62秒
    • 平均生成时间: 19.07秒
    • 评估: BLEU: 0.0032

3. 新Prompt的特点

新Prompt(已在代码中更新)

# rag_base/rag_complete.py:299-310
if any(keyword in query.lower() for keyword in ['summarize', 'email', 'summary']):
    augmented_prompt = (
        f"Answer the question using the provided information. Be concise and direct. Do not analyze the provided information, just give the answer directly.\n\nInformation:\n{source_knowledge}\n\nQuestion: \n{query}"
    )
else:
    augmented_prompt = (
        f"请回答问题,可以使用我提供的信息(不保证信息是有用的),在回答中不要有分析我提供信息的内容,直接说答案,答案要简略。\n\n信息:\n{source_knowledge}\n\n问题: \n{query}"
    )

与旧Prompt的区别

  • 旧Prompt:通用提示"使用提供的信息回答问题"
  • 新Prompt:明确要求"答案要简略,不要有分析,直接说答案"

4. 建议行动

  1. 重新运行Baseline(使用新Prompt)

    • 运行脚本:rerun_baseline_new_prompt_sequential.shrerun_baseline_new_prompt_parallel.sh
    • 确保使用 search-method 0(Baseline RAG)
  2. 检查运行状态

    • 监控日志文件
    • 检查结果文件生成进度
  3. 评估完成后的操作

    • 运行 evaluate_comprehensive.py 计算评估分数
    • 更新最终报告,比较新旧Prompt的效果