Pular para o conteúdo

Execute o LFM3 1.7B localmente: um modelo para aplicações especializadas

Ver no idioma original →

Autoria: Fahd Mirza · Assistir no YouTube

Vídeo de autoria do canal indicado, não da IANIA; todos os direitos pertencem ao criador. Transcrição, resumo e tradução gerados automaticamente; o conteúdo no idioma original é preservado na versão em idioma original.

Idioma original: inglês

Vídeo original: Run LFM3 1.7B Locally: Model for Specialized Applications · Canal: Fahd Mirza · 10:09 · Assistir no YouTube

Tópicos: Agentes de IA, Avaliação e benchmarks de IA, Engenharia de software com IA, Modelos de IA, Modelos locais e open source

O vídeo testa o LFM3 1.7B da Liquid AI, um modelo pequeno com arquitetura híbrida, context window de 256K e ajuste para agent harnesses, executado localmente com llama.cpp. Ele falha ao corrigir um aplicativo de restaurante e ao gerar uma simulação funcional em HTML, mas tem bons resultados em saída estruturada, seguimento de instruções, raciocínio, respostas fundamentadas e tool calling. O teste multilíngue é fraco, enquanto o teste de alucinação é considerado aprovado com ressalvas. A conclusão é que o modelo pode ser útil em tarefas especializadas, mas seu desempenho em programação ainda deixa a desejar.

  • O LFM3 1.7B tem 1,7 bilhão de parâmetros, arquitetura híbrida e context window de 256K.
  • O modelo foi executado localmente com llama.cpp e integrado ao Hermes agent.
  • Falhou ao identificar e corrigir um erro em um aplicativo de restaurante.
  • Também falhou ao gerar uma simulação HTML funcional, devido a uma variável canvas não definida.
  • Passou nos testes de JSON estruturado e de seguimento de instruções com várias restrições.
  • Teve desempenho ruim na tradução para 80 idiomas.
  • Foi aprovado nos testes de raciocínio matemático, respostas fundamentadas e tool calling.
Início Capítulo Resumo
00:01 Apresentação do LFM3 1.7B e teste no aplicativo O apresentador descreve o modelo e o executa localmente para tentar encontrar um erro no aplicativo Wildfire.
02:45 Benchmarks e testes de programação Após comentar os benchmarks, o apresentador constata que o modelo não corrigiu o aplicativo nem gerou uma simulação HTML funcional.
05:53 Saída estruturada, instruções e tradução O modelo passa nos testes de JSON e de seguimento estrito de instruções, mas tem resultados ruins na tradução multilíngue.
08:03 Alucinação, raciocínio e tool calling O modelo é aprovado nos testes de respostas fundamentadas, raciocínio matemático e tool calling, com uma ressalva sobre o fuso horário do lembrete.

Eu diria que isso foi um fracasso. — 04:18

No que diz respeito à saída estruturada, o modelo corresponde ao que afirma. — 06:29

A maior parte não está correta. — 07:32

Conte o que você acha deste modelo. — 10:09

  • Liquid AI (empresa): Empresa que lançou a família de modelos apresentada no vídeo.
  • LFM3 1.7B (modelo): Modelo de 1,7 bilhão de parâmetros testado localmente em tarefas de programação e outras avaliações.
  • llama.cpp (ferramenta): Ferramenta usada para executar o modelo localmente.
  • Hermes Agent (ferramenta): Agent harness ao qual o modelo foi integrado para testar uma tarefa de manutenção de aplicativo.
  • Wildfire (conceito): Aplicativo fictício de gestão de restaurante usado para testar a capacidade do modelo de encontrar um erro.
  • saída estruturada (conceito): Capacidade testada de extrair dados corretos em formato JSON a partir de texto desorganizado.
  • tool calling (conceito): Capacidade avaliada de selecionar ferramentas e preencher seus argumentos, inclusive em duas chamadas na mesma solicitação.

00:01 A Liquid AI lançou uma família inteira de modelos em um único dia. Texto, visão, áudio, omni e até um decision model. Lançamentos em massa como esse sempre me deixam um pouco nervoso, porque, quando você lança tantos modelos de uma vez, a qualidade pode cair. Mas a Liquid diz que são modelos especializados, e os números dos benchmarks parecem muito bons. Então, vamos parar de especular e testar o primeiro: este LFM3 1.7 billion, um modelo com 1,7 bilhão de parâmetros,

00:33 pequeno para os padrões de hoje, com uma arquitetura híbrida, que veremos em breve, e uma context window de 256K. Ele passou por pós-treinamento para agent harnesses como o Hermes agent e, em 4-bit, ocupa cerca de um gigabyte de memória. Então, o que vou fazer neste vídeo é inst… sabe, executá-lo com o llama.cpp. Como podem ver, ele já está rodando. No momento, está consumindo, sabe, cerca de 4,5 GB de VRAM, porque estou executando em BF16, mas vocês podem usar

01:06 4-bit ou até menos, se quiserem. E é aqui que ele está integrado ao meu Hermes agent. Para começar, vou mostrar a ele este aplicativo, que está com problemas. É o Wildfire, o sistema operacional da cozinha de um restaurante em Surrey Hills que serve crocodilo, canguru, emu, camelo, wallaby e muito mais. Basicamente, um documentário sobre a natureza, só que você pode comer os personagens. O dashboard calcula o custo de cada prato. Como podem ver, ele acompanha o estoque e

01:39 transmite os pedidos ao vivo do salão. Agora, olhem com atenção para o topo. Deixem-me mostrar rapidamente. Estão vendo? O custo dos alimentos aparece como 18,9%, excelente, e nenhum prato ultrapassa a meta. Mas as faturas dos fornecedores dizem que gastamos 34,3% das vendas com alimentos. As duas coisas não podem estar certas, não é? Por exemplo, se eu rolar para baixo e mostrar o custo dos alimentos por prato, vejam este pernil de wallaby. Como podem ver, servimos 220 g no

02:11 prato, mas o aplicativo diz que compramos apenas cerca de 101 g. Carnes exóticas perdem muito peso ao serem aparadas e desossadas, então é preciso comprar mais do que se serve. Aqui, o aplicativo está considerando que compramos menos. Há um único bug colocado de propósito por trás de tudo isso, e é bem sutil. O modelo precisa encontrá-lo, e é isso que [limpa a garganta] vou propor como objetivo para este Hermes agent. Vamos ver se ele consegue fazer isso de forma agentic ou não, e quão rápido. Enquanto isso, vamos conversar

02:45 um pouco mais sobre este modelo. Os números que eles compartilharam na publicação do blog sobre os benchmarks são bastante impressionantes. Vejam só. Em comparação com modelos da Cohere e o Google mini CPM, incluindo o modelo de 9 bilhões de parâmetros da Cohere, que é várias vezes maior, este modelo minúsculo lidera ou fica bem próximo deles na maioria dos testes de uso de agent e de ferramentas. Porém, ele fica atrás dos modelos maiores em algumas áreas, e a diferença aparece mais na programação agentic.

03:16 Mas o fato é que os benchmarks são muito interessantes, considerando o tamanho do modelo, e é exatamente isso que estamos testando aqui. A propósito, recentemente comecei esta newsletter semanal gratuita sobre IA em fahadmirza.substack.com. E, se quiserem ajudar o canal, tornem-se membros. Se estiverem procurando alugar uma GPU por um preço muito bom, vocês encontram o link para a Mass Compute na descrição do vídeo. O modelo respondeu. Se vocês analisarem esta

03:47 resposta, ela diz que o objetivo foi alcançado e que, em seguida, corrigiu todos os números. Mas o problema é que são os mesmos números com que começamos, e que estavam errados. Se eu voltar ao site e recarregá-lo — acabei de apertar Control+F5 —, vocês verão que são os mesmos números. Nada mudou de verdade. O mesmo custo dos alimentos. E, se eu for até o pernil de wallaby, são os mesmos números. Nada

04:18 mudou. Continua dizendo, sabe, que são os mesmos gramas de antes. Então, eu diria que isso foi um fracasso. O que não é exatamente o que os benchmarks indicam. Enfim, vamos fazer agora um teste de geração de código. Em seguida, pedi que ele criasse um arquivo HTML autocontido para simular um kebab donair, e foi isso que ele fez. Ele diz

04:48 que criou tudo. Então, copiei o conteúdo daqui e, quando abro — vou abrir de novo na frente de vocês —, só vejo uma página em branco. Ou seja, nada. Vou dar mais uma chance e dizer que a página está em branco. A prévia do HTML está em branco e não mostra nenhuma simulação. Vamos ver se ele consegue

05:18 corrigir isso agora. Certo, mais uma chance, e ele diz que fez de novo. Deixem-me abrir e talvez colocar em outra aba. Aí está. Continua sem mostrar nada. Vou dar uma olhada rápida no código. Este é o código. Dei uma conferida rápida e, na linha 16, ele usa uma variável chamada canvas que nunca foi definida. Esse é um erro muito, muito simples, que nenhum modelo agentic ou de programação

05:53 deveria deixar passar nos dias de hoje, mesmo que tenha menos de 2 bilhões de parâmetros. Então, não acho que ele já esteja pronto para programação. O segundo teste também falhou. Vamos fazer outro. Agora, para ser justo com o modelo, ele não é exatamente um modelo típico de programação. O cartão do modelo também diz isso. Então, não vou testar as capacidades em que ele se destaca. Para começar, vou testar a saída estruturada, extraindo JSON limpo deste texto confuso. Este é o meu prompt. Vamos executar e conferir.

06:29 E esta é a resposta. O bom é que ela corresponde ao que eles afirmaram. O JSON é válido e todos os valores estão corretos. Fornecedor, 12 kg de pernil de wallaby e tudo mais. Ele deixou de fora o estoque automático de crocodilo e retornou apenas o JSON, como pedi. Então, em saída estruturada, como eu disse, o modelo corresponde ao que eles próprios afirmam. Muito bom. Vamos fazer outro teste. O próximo é sobre seguir instruções rigorosas, em que o modelo precisa cumprir várias restrições estritas ao mesmo tempo. O pedido foi escrever exatamente quatro frases sobre a aurora boreal

07:02 que começassem com “star”, sem vírgulas e com menos de 60 palavras. Como podem ver, o resultado foi aprovado. Quatro frases começando com “star”, sem vírgulas e com exatamente 43 palavras. Esse também é um resultado impressionante. Em seguida, temos este teste multilíngue, em que peço que traduza a frase “não conte com os ovos antes de a galinha botar” para todos estes 80 idiomas. E então vocês podem ver que ele fez algumas traduções.

07:32 Agora, a maior parte não está correta. Vocês também podem conferir no idioma de vocês. Acho que as versões em espanhol, francês e russo contêm palavras que nem existem. As versões em latim e turco estão parcialmente em inglês; os idiomas do sudeste do Canadá estão todos com a escrita errada, e o modelo admite que não consegue realmente oferecer recursos multilíngues em grande escala. Então, acho que isso é mais um fracasso. Talvez ele nem seja um modelo multilíngue.

08:03 Em seguida, estou testando alucinações usando um artigo que não existe, como podem ver neste prompt. Peço que ele resuma as conclusões de um artigo inventado, de 1987, da Dra. Margaret Elderwick. E podem ver que ele passou com louvor no ponto principal, já que não inventou resumo algum. Mas também culpou a falta de ferramentas e não disse que o artigo talvez não existisse. Mas sabem de uma coisa? Eu consideraria isso aprovado, porque não vamos ficar procurando pelo em ovo aqui

08:34 demais. Em seguida, estou testando o raciocínio em várias etapas usando os mesmos cálculos de rendimento que fizeram o aplicativo Wildfire falhar, aliás. E vejam esta resposta. Ele calcula quanto pernil de wallaby comprar para 150 pratos, e o resultado foi aprovado. Então, 71,74 kg. Os números estão certos, e acho que a resposta é muito boa, além de rápida, como podem ver. O próximo teste é sobre respostas fundamentadas

09:06 em que o modelo deve usar apenas o texto fornecido e dizer “não está no texto” quando a resposta não estiver lá. E você pode ver que, nas três perguntas em que pedi que respondesse com base em um trecho curto, o modelo passou nas três, inclusive na pergunta cuja resposta não estava no texto. Então, ele não inventou nada, o que é realmente impressionante. E, por fim, estou fazendo o teste de tool calling, em que o modelo precisa escolher as ferramentas certas e preencher os argumentos, incluindo duas chamadas em uma única solicitação. Então, se você olhar o prompt, o pedido é para definir um lembrete para ligar para o fornecedor às

09:38 15h de amanhã e consultar a previsão do tempo em Sydney em Celsius. Depois de pensar bastante, ele voltou com a resposta e me forneceu um JSON válido com as ferramentas e os argumentos corretos. Houve um pequeno deslize: o horário do lembrete ficou às 15h UTC, e não às 15h no horário de Sydney, porque eu não informei nenhum fuso horário. Então, vou considerar que passou. Como você pode ver, além de programação, esse modelo de 1,7 bilhão de parâmetros teve um bom desempenho, e a performance também é muito boa. Então,

10:09 confira. Me diga o que acha desse modelo. Vamos abordar o restante do lote muito em breve, então fique ligado. E obrigado por todo o apoio.

Transcrição original

[00:01] Liquid AI has released a whole family of models in one day. Text, vision, audio, omni, and even a decision model. Bulk releases like this always make me a little nervous because when you ship this many models at once, quality can slip. But Liquid says these are specialized models and the benchmark numbers look quite good. So, let’s stop guessing and we are going to test the first one, which is this LFM3 1.7 billion, a 1.7 billion parameter model,

[00:33] tiny by today’s standards with a hybrid architecture, which we will also see shortly, and 256K context window. It is post trained for agentic harnesses like Hermes agent and at 4-bit it fits in about a gigabyte of memory. So, what I’m going to do in this video, I’m going to inst- you know, run it with llama.cpp. As you can see, it is already running. At the moment, it is consuming you know, VRAM like 4.5 gig because I’m running it in BF16, but you can go with

[01:06] the 4-bit or even lower if you like. And this is where it is integrated with my Hermes agent. First up, what I’m going to do here is to give it this application, which is a broken app. It is Wildfire, the kitchen OS of a Surrey Hills restaurant serving crocodile, kangaroo, emu, camel, wallaby, and more. Basically, a nature documentary except you get to eat the cast. The dashboard costs every plate. As you can see, it tracks stock, it

[01:39] streams live orders from the floor. Now, look closely at the top. Let me quickly take you up. So, you see food cost says 18.9% excellent and not one dish is over target. But the supplier invoices say we spent 34.3% of sales on food. Both cannot be true, right? So, for example, if I scroll down and show you the food cost by this dish and look at this wallaby shank here, for example. So, you see, we serve 220 g on the

[02:11] plate, but the app says we only buy about 101 g. Exotic meat loses a lot of weight to trimming and boning, so you must buy more than you serve. Here, the app is thinking we buy less. There is one planted bug behind all of it and quite a subtle one. And the model has to find it, and that is what [clears throat] I’m going to give this as a goal in this Hermes agent. Let’s see if it is able to do that in this agentic fashion or not and how quickly. While that happens, let’s talk

[02:45] a bit more around this model. The numbers which they have shared on their um blog post regarding the benchmarks are quite striking. Look at this. Against models from Cohere and Google mini CPM, including Cohere’s 9 billion parameter model, that is several times its size, this tiny model leads or stays right up with them on most of the agent and tool use test. It though trails the bigger models in a couple of areas, and agentic coding is where the gap shows most.

[03:16] Um but the thing is that the benchmarks, given the size of the model, are very interesting, and that is exactly what we are testing here. By the way, recently I have started this free weekly AI newsletter at fahadmirza.substack.com, and if you want to help out the channel, please become a member. And if you’re looking to rent a GPU on very good price, you can find the link to Mass Compute in video’s description. The model has come back with the response, and if you go through this

[03:47] response, it says goal achieved, and then it has fixed all of the numbers. But the thing is these are the same numbers which were broken we started with. If I take you back to the website and then if I reload it, I have just pressed control F5. You see, these are the same numbers. Nothing has really changed. The same food cost and if I just go to wallaby shank. These are the same numbers. Nothing um

[04:18] has changed. It still says it might uh you know, the same number of grams as earlier. So, uh I would call this that this is a fail. Which is not really what the benchmarks say here. Anyway, let’s do now a code generation test. Next up, I asked it to create the self-contained HTML file to simulate a donair kebab and this is what it has done. It says

[04:48] that it has created everything. So, I just copied this from here and when I open it and I’ll open it again in front of you, it just shows me blank page. So, nothing. So, I’m going to give it another chance and I’m going to ask it that the page is blank. HTML preview is blank. Sorry. And doesn’t show any simulation. Let’s see if it is able to

[05:18] fix it up now. Okay, one more chance and it says that it has done it again. Let me just open it and maybe I will just put it in another tab. There you go. Still nothing. And let me have a quick look at the code. So, this is the code. I have quickly reviewed it and this line 16, it uses a variable canvas that is never defined. And that is a very very simple error which no agentic or coding

[05:53] model in this day and age should miss even if it is under 2 billion parameter. So, it’s a I don’t think so the coding is there yet. So, the second test test is also failed. Let’s do another one. Now, to be fair to the model, this is not exactly your typical coding model. And the card also says that. So, I’m going to not play according to the strengths of the model. First up, I’m going to test this structured output by pulling clean JSON out of this messy text. So, this is my prompt. Let’s run this to check it out.

[06:29] And this is the answer. And the good thing is that it has matched their claim. JSON is valid and every value is correct. Supplier 12 kg wallaby shank and all that stuff. It left out the auto stock crocodile and returned only the JSON as I asked. So, on structured output, as I said, the model matches their own claim. Pretty good. Let’s do another one. Next one is about strict instruction following where the model must meet several hard constraints at once. So, the ask was to write exactly four sentences about the northern lights

[07:02] starting with star or s t a n r with no commas and under 60 words. So, you see the result is pass. Four sentences starting with star, no commas, and exactly 43 words. So, that is also an impressive result. Next up, this is multilingual test where I’m asking it to translate this sentence don’t count your chicken before they hatch into all these 80 languages. And then you can see that it has done some translation.

[07:32] Now, most of it is is not correct. You can check your language, too. I think Spanish, French, Russian contain words that don’t even exist. Latin and Turkish are left partly in English, the legal Canada southeastern languages, all wrong scripts, and model admits that it cannot really do any multilinguality at scale. So, I think that is again a fail. Maybe it is not a multilingual model at all.

[08:03] Next, I’m testing hallucination using a paper that does not exist, as you can see from this prompt here. I’m asking it to summarize the finding of a made-up 1987 paper by Dr. Margaret Elderwick. And you can see that it has passed it with flying colors on the main point since it invented no summary at all, but then it also blamed missing tools and never said the paper might not exist. But you know what? I would take it as a pass because we don’t nitpick here too

[08:34] much. Next up, I’m testing this multi-step reasoning using the same yield math that broke the wildfire application, by the way. And then look at this response. It works out how much wallaby shank to buy for 150 plates, and it is a pass. So, 71.74 kg. The numbers are right, and I think that it is quite a good answer, and very quickly, too, as you can see from this response. Next one is all about grounded answering

[09:06] where the model must use only the given text and say not in the text when the answer to this missing and you can see for all these three questions where I have asked this to answer from a short passage, model has passed all three, which is including not in the text. So, it didn’t make up anything, which is really impressive. And finally, I’m doing the test of tool calling where the model must pick the right tools and fill in the arguments, including two calls in one request. So, if you look at the prompt, the ask is to set a reminder to call the supplier at

[09:38] 3:00 p.m. tomorrow and get the weather in Sydney in Celsius. After thinking a lot, it has come back with the response and given me the valid JSON with both correct tools and correct arguments. There is one slight slip, which is the reminder time, which is 3:00 p.m. UTC and not 3:00 p.m. Sydney time because I didn’t really give it any time zone, so I will call call it as a pass. So, you see other than coding, this 1.7 billion parameter model has performed well and the performance is quite good, too. So,

[10:09] check it out. Let me know what do you think about this model. We will be covering the rest of the lot very soon and so say stay tuned and thank you for all the support.