V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Alias4ck
V2EX  ›  分享发现

LLM 评估

  •  
  •   Alias4ck · 78 天前 · 661 次点击
    这是一个创建于 78 天前的主题,其中的信息可能已经有所发展或是发生改变。

    今天看到一个有意思的 repo,作者用一个 DSL 来评估 LLM 的能力

    DSL

    "Write a C program that draws an american flag to stdout." >> LLMRun() >> CRun() >> \
        LLMRun("What flag is shown in this image?") >> \
            (SubstringEvaluator("United States") | SubstringEvaluator("USA") | SubstringEvaluator("America"))
    

    其中有一个 python convert to c(这个我第一次没反应过来哈哈) 问题很有意思,所有的 llm 都错了.

    Question

    
    def foo(x):
        sum = 0
        for i in range(x):
            x += i
            sum += x
        return sum
    

    LLM OUTPUT

    #include <stdio.h>
    
    int foo(int x) {
        int sum = 0;
        for (int i = 0; i < x; i++) {
            x += i;
            sum += x;
        }
        return sum;
    }
    
    int main() {
        int result = foo(5); // Example call, replace 5 with any integer to test with different values
        printf("Result: %d\n", result);
        re
    

    Reference

    python_to_c_loop_update

    1 条回复    2024-02-21 19:38:03 +08:00
    devliu1
        1
    devliu1  
       78 天前
    不错
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1123 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:00 · PVG 03:00 · LAX 12:00 · JFK 15:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.