noahliaszn

LLM 评估

  •  
  •   noahliaszn · Feb 21, 2024 · 1235 views
    This topic created in 855 days ago, the information mentioned may be changed or developed.

    今天看到一个有意思的 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 replies    2024-02-21 19:38:03 +08:00
    devliu1
        1
    devliu1  
       Feb 21, 2024
    不错
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   899 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 20:37 · PVG 04:37 · LAX 13:37 · JFK 16:37
    ♥ Do have faith in what you're doing.