通过具体任务对比两个模型性能,帮助开发者按场景选择开源或商用方案。
实现
数据处理:Middleware 前来救场
模型集成:FireworksAi 与 OpenAI
数据处理:Middleware 前来救场
模型集成:FireworksAi 与 OpenAI
评估与结果:GPT4o 对比 LLAMA 3.1
数学准确性
数据分析
可操作性
总结能力
数学准确性
Middleware 是一个帮助工程负责人从数据中提炼可执行洞察并改进流程的平台,从而提升开发团队的效率。随着 AI 领域的飞速发展,我们一直在尝试将 ML 模型集成到产品的各个环节,目标是从数据中提炼出可执行的洞察。经过一段时间的探索,我们发现,原本想采用的开源 LLAMA 或 Mistral 模型虽然表现不错,但在处理以数据为核心的问题时,GPT4o 更加可靠。因此,我们决定采用更复杂的方案:构建 RAG pipeline,并使用 function calling。
然而,当我们得知 Meta 发布了 LLAMA 3.1 系列模型后,一切都变了。70B 和 405B 模型无疑是目前最出色的开源模型之一,足以与 GPT4o 正面竞争。因此,我们决定开展一项实验,将 AI 驱动的 DORA 报告集成进来,看看 GPT4 和 LLAMA 3.1 在数据分析与推理方面的表现究竟如何。
DORA metrics 能够为软件交付流程的性能和可靠性提供关键洞察。
前置时间由首次提交到 PR 创建时间、首次响应时间、返工时间、合并时间,以及从合并到部署的时间组成。
该指标用于衡量代码变更部署到生产环境的频率。
MTTR 衡量团队在生产环境发生故障后恢复服务的速度。
团队解决 incident 的平均时间,就是其 MTTR。
CFR 衡量导致生产环境服务受损或中断的变更所占百分比,有助于评估部署流程的稳定性与可靠性。
CFR 的计算方式,是将某个时间区间内的 incident 与 deployment 关联起来;每次 deployment 可能对应多个 incident,也可能没有 incident。
你可以进一步了解 DORA metrics。借助先进的 LLM,我们希望自动完成这些指标的分析,为团队提供更深入、更具可操作性的洞察。
将 LLM 集成到 Middleware 中,用于分析 DORA metrics。
比较不同大语言模型在以下方面的表现:
数学准确性:它计算 DORA score 的能力如何?
数据分析:LLM 能否分析输入数据并得出正确推论?
总结能力:模型总结数据的效果如何?
可操作性:模型能否根据输入数据给出切实可行的行动方案?
数学准确性:它计算 DORA score 的能力如何?
数据分析:LLM 能否分析输入数据并得出正确推论?
总结能力:模型总结数据的效果如何?
可操作性:模型能否根据输入数据给出切实可行的行动方案?
Middleware 会同步来自不同数据源的全部数据,并为你的团队计算 DORA Metrics。
请查看 middlewarehq/middleware,并使用 Docker 配置开发服务器。
我们集成了 OpenAI GPT4o 和 LLAMA 3.1(70B 与 405B)模型。
OpenAI 模型底层使用官方 OpenAI API,而 LLAMA 3.1 的 70B 和 405B 模型则通过 Fireworks AI API 集成。
这些 AI 分析能力由 analytics server 中的 AIAnalyticsService 提供。该服务可以进一步扩展:既能使用更多来自 OpenAI 的闭源模型,也能通过 FireworksAi 使用 OpenSource 模型。
这些 AI 分析能力由 analytics server 中的 AIAnalyticsService 提供。该服务可以进一步扩展:既能使用更多来自 OpenAI 的闭源模型,也能通过 FireworksAi 使用 OpenSource 模型。
前端变更引入了相关组件与 BFF 逻辑,允许用户输入自己的 token、选择大语言模型,并为 DORA Metrics 生成 AI 报告。
前端变更引入了相关组件与 BFF 逻辑,允许用户输入自己的 token、选择大语言模型,并为 DORA Metrics 生成 AI 报告。
每当用户尝试生成 AI 分析时,UI 都会向 BFF API internal/ai/dora_metrics 发起 POST 请求,其中包含所有预处理后的 DORA Metrics 和趋势数据。
每当用户尝试生成 AI 分析时,UI 都会向 BFF API internal/ai/dora_metrics 发起 POST 请求,其中包含所有预处理后的 DORA Metrics 和趋势数据。
这个 BFF API 会在内部携带 DORA metrics 和趋势数据调用多个 analytics API,后者再根据处理后的数据与精心设计的 prompt 生成分析结果。
这个 BFF API 会在内部携带 DORA metrics 和趋势数据调用多个 analytics API,后者再根据处理后的数据与精心设计的 prompt 生成分析结果。
最后,每项指标趋势的分析结果会再次输入 LLM 进行总结,随后所有数据都会发送至前端。
最后,每项指标趋势的分析结果会再次输入 LLM 进行总结,随后所有数据都会发送至前端。
更多实现细节可以在这个 pull request 中找到。
我们对以下开源仓库进行了 7 月份的 DORA AI 分析:facebook/react、middlewarehq/middlware、meta-llama/llama 和 facebookresearch/dora。
Middleware 根据 dora.dev 提供的指南,为团队生成 DORA Performance Score。
为了测试模型的计算准确性,我们向模型提供四项关键指标,通过 prompt 要求 LLM 生成 DORA Score,再将结果与 Middleware 的计算结果进行比较。
这四个 key 采用以下格式的 JSON:{ "lead_time": 4000, "mean_time_to_recovery": 200000, "change_failure_rate": 20, "weekly_deployment_frequency": 2 }
这四个 key 采用以下格式的 JSON。
{
"lead_time": 4000,
"mean_time_to_recovery": 200000,
"change_failure_rate": 20,
"weekly_deployment_frequency": 2
}
- The Actual Dora Score for the repositories was around 5. While OpenAi’s GPT4o was able to predict the score to be 4-5 most of the times, LLAMA 3.1 405B a margin away.
_DORA Metrics score: 5/10_

_GPT 4o with DORA score 5/10_

_LLAMA 3.1 with DORA Score 8/10 (incorrect)_

GPT 4o DORA Score was closer to the actual DORA score than LLAMA 3.1 in 9/10 cases, hence GPT4o was more accurate compared to LLAMA 3.1 in this scenario.
### Data Analysis
- The trend data for the four keys dora metrics, calculated by Middleware, was fed to the LLMs as input along with different experimental prompts to ensure a concrete data analysis.
- The trend data is usually a JSON object with date strings as keys, representing weeks' start dates mapped to the metric data.
{
"2024-01-01": {
...
},
"2024-01-08": {
...
}
}
- *Mapping Data*: Both the models were at par at extracting data from the JSON and inferring the data in the correct manner. Example: Both GPT and LLAMA were able to map the correct data to the input weeks without errors or hallucinations.
_Deployment Trends Summarised: GPT4o_

_Deployment Trends Summarised: LLAMA 3.1 405B_

- **Extracting Inferences**: Both the models were able to derive solid inferences from data.
- LLAMA 3.1 identified week with maximum lead time along with the reason for the high lead time.
- This inference could be verified by the Middleware Trend Charts.
- GPT4o was also able to extract the week with the maximum lead time and the reason too, which was, high first-response time.
- **Data Presentation**: Data representation has been a hit or miss with LLMs. There are cases where GPT performs better at data presentation but lacks behind LLAMA 3.1 in accuracy and there have been cases like the DORA score where GPT was able to do the math better.
- LLAMA and GPT were both given the lead time value in seconds. LLAMA was able to round off the data closer to the actual value of 16.99 days while GPT rounded off the data to 17 days 2 hours but presented the data in a more detailed format.
_GPT4o_
_LLAMA 3.1 405B_
### Actionability
<img width="100%" style="width:100%" src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExZXFmcmM2cno2c3liN3doeXJ6Z282NmxrZDN0ZGd3c2xta2RwOXp5eCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/jsrfOEfEHkHPFSNlir/giphy.gif">
- The models were able to output similar actionables for improving teams' efficiency based on all the metrics.
- Example: Both the models identified the reason for high lead-time to be first-response time and suggested the team to use an alerting tool to avoid delayed PR Reviews. The models also suggested better planning to avoid rework where rework was high in a certain week.
_GPT4o_
_LLAMA 3.1 405B_
### Summarisation
To test out the summarisation capabilities of the models we asked the model to summarise each metric trend individually and then feed the output results for all the trends back into the LLMs to get a summary or in Internet's slang *DORA TLDR* for the team.
The summarisation capability of large data is similar in both the LLMs.
_LLAMA 3.1 405B_

_GPT4o_

## Conclusion
For a long time LLAMA was trying to catch up with GPT in terms of data processing and analytical abilities. Our earlier experimentation with older LLAMA models led us to believe that GPT is way ahead, but the recent LLAMA 3.1 405B model is at par with the GPT4o.
If you value data privacy of your customers and want to try out the open-source LLAMA 3.1 models instead of GPT4, go ahead! There will be negligible difference in performance and you will be able to ensure data privacy if you use self hosted models. Open-Source LLMs have fin
middlewarehq / middleware
✨ 面向工程团队的开源 DORA metrics 平台 ✨
释放开发者潜能的开源工程管理工具
加入我们的开源社区
Middleware 是一款开源工具,旨在帮助工程负责人使用 DORA metrics 衡量并分析团队效能。DORA metrics 由四项关键指标组成,可以揭示软件交付性能与运营效率。
部署频率(Deployment Frequency):代码部署到生产环境或运行环境的频率。
变更前置时间(Lead Time for Changes):一次 commit 进入生产环境所需的时间。
平均恢复时间(Mean Time to Restore):发生 incident 或故障后恢复服务所需的时间。
变更失败率(Change Failure Rate):导致失败或需要补救的 deployment 所占百分比。
Middleware——开源功能
快速开始
安装 Middleware
故障排查
开发者配置
使用 Gitpod
使用 Docker
手动配置
使用方法
DORA 的计算方式
Roadmap
贡献指南……
快速开始
安装 Middleware
故障排查
安装 Middleware
开发者配置
使用 Gitpod
使用 Docker
手动配置
DORA 的计算方式
贡献指南
如需采取进一步措施,你可以考虑屏蔽此人和/或举报滥用行为。