Grok 4 Fast now has 2M context window

(docs.x.ai)

85 points | by hereme888 6 hours ago ago

104 comments

  • changoplatanero 6 hours ago ago

    Anyone can make a long context window. The key is if your model can make effective use of it or not.

    • mg 6 minutes ago ago

      If a model is not making use of the whole context window - shouldn't that be very noticeable when the prompt is code?

      For example when querying a model to refactor a piece of code - would that really work if it forgets about one part of the code while it refactors another part?

      I concatenate a lot of code files into a single prompt multiple times a day and ask LLMs to refactor them, implement features or review the code.

      So far, I never had the impression that filling the context window with a lot of code causes problems.

      I also use very long lists of instructions on code style on top of my prompts. And the LLMs seem to be able to follow all of them just fine.

    • chucknthem 6 hours ago ago

      How do they make the context window longer? (serious question, I want to learn how this works)

      • TheCoolGuy 6 hours ago ago

        You literally just shift the window over by to the next token once you reach the max amount of tokens you want for context window, NOT with what you train on, (only limited with memory now)

        This has obvious issues since you're now losing information from the now unseen tokens which becomes significant if your context window is small in comparision of the answer/question you're looking at. That's why companies try to give stupidly large context windows. The problem is they're not training on the large context window, they're training on something smaller (2048 and above). Due to how attention is setup, you can train on a small amount of context and extrapolate it to any number of tokens possible since they train via ROPE which trains the model because on words and their offset to the neighboring words. This allows us to effectively x2,x3,x10,x100 the amount of tokens we generate vs train with with some form consistency BUT still cause a lot of issues consistency wise since the model approaches more of a "this was trained on snippets but not the entire thing" situation where it has a notion of the context but not fundamentally the entire combined context

        • vlovich123 5 hours ago ago

          That’s a very basic way to keep the LLM inferring past the context window size (there’s better, smarter ways) but that’s not at all what the question was which is how they train a 2M token length window. My understanding at a basic level is that you need corpuses that are >2M in length for training data which is where the problem comes in for - there’s only so much long form content and it’s swamped by all the smaller stuff. I think there’s probably tricks now but I suspect it’s still largely an open problem.

          • Ey7NFZ3P0nzAe 2 hours ago ago

            AFAIK nobody does that. They train on much much shorter text but with use tricks in the position encoding steps that can be extrapolated by the LLMs. Lile ROPE and YARN etc.

    • ggeorgovassilis 5 hours ago ago

      I came here just to complain about that :-) All LLMs I used seem to give more weight to things at the beginning of the context window and omit many details. Eg. I tried this simple thing: pasted a friend's and my CV into Gemini and asked it to recommend topics for a joint conference presentation. Results depended greatly on the order of CVs pasted in.

    • retinaros 2 hours ago ago

      no one makes effective use of long context.

    • bigyabai 6 hours ago ago

      Long context window = huge amounts of vacant VRAM = our servers are fucking empty

      • trash_cat 6 hours ago ago

        But isn't context window dependent on model architecture and not available VRAM that you can just increase or decrease as you like?

        • reasonableklout 6 hours ago ago

          Most attention implementations can work across an arbitrarily long context.

          The limiting factors are typically: 1. Often there are latency/throughput requirements for model serving which become challenging to fulfill at a certain context length. 2. The model has to be _trained_ to use the desired context length, and training becomes prohibitively expensive at larger contexts.

          (2) is even a big enough problem that some popular open source models that claim to support large context lengths in fact are trained on smaller ones and use "context length extension" hacks like YaRN to trick the model into working on longer contexts at inference time.

        • onion2k 3 hours ago ago

          The model will use the full context if it's been designed well, but you can still increase the size of the window on models where it hasn't. It's just pointless. People who don't know much about LLMs will still think "bigger number is better" though.

    • nbardy 6 hours ago ago

      No they can't, it's a N^2 algorithm, just fitting it in the context window is a challenge.

      And sure maybe not 2mil of it is usable, but they're reliably pushing the frontier here.

  • nsoonhui an hour ago ago

    It's a shame that the top comments are focusing more on Elon Musk, his personality and politics rather than the quality of the model per se.

    Speaking about Elon, regardless of what you think of him, he really does get things done, despite naysayers -- SpaceX, Tesla, Neuralink and even get Trump elected ( despite subsequent fallout) etc. Even Twitter is finding a second life by becoming a haven for the free speech advocates and alternative views, much to the chagrin of MSMs because they now no longer have the monopoly on the "truth", and censoring "fake news" becomes hard.

    People like Elon are almost by definition contrarian ( you don't change the world by being a conformist), that should align well with the predilection of the intended audience here. So it's a surprise to me that HNs are almost uniformly, vehemently anti-Musk. It's almost as if the ultimate embodiment of the hacker spirit -- Musk -- is being rejected by his own kind, the very kind that he is supposed to inspire.

    • letmetweakit an hour ago ago

      In my understanding of the hacker ethos, hackers appear to be genuinely nice people who mean to do good for society and regular people. Elon does not align with those values according to some people so they reject him and his activities.

      • vachina 32 minutes ago ago

        What’s not nice about Elon though. Besides being rich.

        • bertili 16 minutes ago ago

          Besides the obvious right wing interference in politics, star link weaponization in some countries - how can anybody stomach the saving-humanity-agenda while running a major social media unresponsiveliy without caring of moderation, its consequences for real people?

    • wewewedxfgdf an hour ago ago

      >> regardless of what you think of him, he really does get things done, despite naysayers -- SpaceX, Tesla, Neuralink and even get Trump elected

      It matters how people behave.

  • mehdibl 6 hours ago ago

    What matter is not context or the recod token/s you get.

    But the quality for the model. And it seem Grok pushing the wrong metrics again, after launching fast.

    • saretup 6 hours ago ago

      Seems reductive. Some applications require higher context length or fast tokens/s. Consider it a multidimensional Pareto frontier you can optimize for.

    • jeswin 6 hours ago ago

      Depends. For coding at least, you can divide tasks into high-intelligence ($$$) and low-intelligence ($) tasks. Being able to do low-intelligence tasks super fast and cheap would be quite beneficial. A majority of code edits would fall into the fast-and-cheap subset.

  • cactusplant7374 6 hours ago ago

    I had a failed refactor with Codex recently and I am wondering if context window size is the cause.

    • port3000 an hour ago ago

      I use Claude Code, haven't used Codex yet (should I?) - but in Claude code you can spin up sub-agents to handle these big refactors, with the master context window just keeping track of the overall progress, bugs, etc and providing instructions to the subagents to do the rote work.

    • jakevoytko 5 hours ago ago

      With the current crop of LLMs/agents, I find that refactors still have to be done at a granular level. "I want to make X change. Give me the plan and do not implement it yet. Do the first thing. Do the second thing. Now update the first call site to use the new pattern. You did it wrong and I fixed it in an editor; update the second call site to match the final implementation in $file. Now do the next one. Do the next one. Continue. Continue.", etc.

    • sgc 5 hours ago ago

      I not an expert ai user (and have never touched Codex), but anything remotely important I do, I force the smallest context window possible. I just did something very beautiful using that principle, which will soon be ready to show the world. It would have been a garbled pile of garbage with long context windows.

      Obviously major architectural changes need a bigger context window. But try to aggressively modularize your tasks as much as you can, and where possible run batch jobs to keep your workflow moving while each task stays a smaller chunk.

    • enraged_camel 2 hours ago ago

      For complex refactors, I use "max mode" in Cursor, which in my experience noticeably improves the AI's performance and makes it go for a lot longer before it starts to drift. I haven't looked into how it works exactly, but it works well if you don't mind the extra cost.

  • behnamoh 6 hours ago ago

    Who here actually uses Grok? It's sad to see Elon's arc but when he doubled down on some of his political ideas he had it coming with the Tesla sales going down and x.ai not taken seriously.

    I've always tried to remain apolitical and unbiased but it's hard to overlook who's behind a technology you wanna buy. Not that sama and others are saints either, it's just Elon's very obvious and vocal about it.

    It's a shame, really, because Grok is a good model. But Elon promised to open source the previous model and it took them forever to do that with Grok 3. Sorry, but I wanna buy from someone who keeps their promises ("FSD by next year").

    • RobKohr 5 hours ago ago

      I like grok for noncoding stuff. I find it hasn't been tuned for "Safety" (meaning it isn't tuned much for political correctness). It also seems good at making images and stories up well. I run some choose your own adventures stories with my kids through it. We tell it who each of their characters are and what the theme is for the night and grok gives them each a section of story and 4 choices. They also have the option of choosing something different then suggested. We have it so it cycles around the turns for everyone. Works pretty well, and if the kids wanna go dark (preteen boy) grok doesn't mind the violence.

      Kinda reminds me of the video game from enders game.

      • wqaatwt 2 hours ago ago

        > it isn't tuned much for political correctness

        It was tuned to be edgy and annoying though (I mean his general style of speech not necessarily the content).

        • vachina 31 minutes ago ago

          Being offended by an LLM though

      • vlovich123 5 hours ago ago

        > meaning it isn't tuned much for political correctness

        Is being tuned for right wing viewpoints the same as not being tuned for political correctness? Because there is tuning happening to a specific viewpoint:

        https://gizmodo.com/elon-says-hes-working-to-fix-grok-after-...

        • gitaarik 2 hours ago ago

          Yeah, but you can argue that the AI has been biased because of biased training data.

          Ultimately every AI is biased based on what you train it on and how you instruct it.

          I tend to use LLMs from different companies and personally compare them, and read between the lines.

          • Yoric an hour ago ago

            > I tend to use LLMs from different companies and personally compare them, and read between the lines.

            Read between the lines? Does this mean that you're using LLMs as a source of information?

    • minimaxir 5 hours ago ago

      Going off OpenRouter's rankings (https://openrouter.ai/rankings), Grok Code Fast 1 is the most used model by a significant margin, and since those metrics are calculated as of this week, that's after providers stopped giving free promotional access to it. Grok 4 Fast is #5 on that list which was never free.

      In terms of models, Grok 4 Fast has essentially zero restrictions on safety, which a) makes it unusable for most applications that allow user input and b) makes it extremely useful for certain applications.

      • BoredPositron an hour ago ago

        It's the only model that lets you do gooner shit. That's why the usage is highly skewed. You can just call a horse a horse if you see one.

        • Squarex 7 minutes ago ago

          this is a code model, not the general one

    • rjdj377dhabsn 6 hours ago ago

      For at least the last year, I've been using Grok for 90% of my queries. I pay for their $30 plan as well as $20 for Claude Code, which I only use for simple development projects. For anything more complicated, Grok's expert mode has consistently better results.

    • raincole 5 hours ago ago

      In my experience Grok Fast is the best "cheaper" model out there. Far better than Haiku 4.5 and Gemini Flash. I don't think the other cheaper models should be treated seriously at this point.

      • behnamoh 5 hours ago ago

        Gemini Flash is the first model I disable in any tool I use. It's a joke, and to add salt to injury, google announced a "lite" version of that as well!

    • LorenDB 5 hours ago ago

      I do! I have felt bad vibes from OpenAI for a while now, and eventually defaulted to Grok as somewhat the lesser of many evils. I respect anybody who doesn't wish to use it, but it's good enough for what I need it for. Case in point: it just spit out valid OpenSCAD code for an adapter piece I want to 3D print.

    • schappim 3 hours ago ago

      I used Grok to successfully split a large 10K-line file of spaghetti code into multiple smaller well organised files. This was after giving the same task to Claude, OpenAI, and Gemini, all of which consistently failed.

      Grok certainly has its uses, but I default to OpenAI for most business tasks and Claude for code.

    • kelsolaar 6 hours ago ago

      As you point out, Sam Altman is not exactly an altar boy: https://fastcompany.co.za/business/2025-11-07-sam-altmans-tr...

      • darkwater 2 hours ago ago

        I don't think you can compare the usual internal backstabbing between executives with someone who literally directed and participated in acts of the US Government, and keep saying and doing things to help and nurture a certain side of the political spectrum.

        • vasco 2 hours ago ago

          Both do both.

          • diputsmonro 7 minutes ago ago

            Did Sam Altman lead a government agency and camp in the Oval Office for months too? Degrees matter.

          • wqaatwt 2 hours ago ago

            Not to an even remotely same degree..

      • andai 5 hours ago ago

        Thought this would be about the whistleblower. They didn't even mention it!

        • roman_soldier an hour ago ago

          Yes allegedly having an employee bumped off for whistleblowing and the sister thing is way worse than someone having a different opinion than you. One is criminal the other is free speech.

    • supriyo-biswas 6 hours ago ago

      I've been occasionally using Grok and found it good for devops stuff; specifically it often is able to explain and produce working configurations without getting lost or introducing subtle mistakes as I've sometimes seen with other models.

    • gitaarik 2 hours ago ago

      All propietary AIs are probably biased in some way. I mean, that is the power of them and the reason they're propietary, right?

      So I tend to use different LLMs from different providers, personally compare them and read between the lines.

    • weird-eye-issue 6 hours ago ago

      > I've always tried to remain apolitical and unbiased

      Clearly

    • mudkipdev 5 hours ago ago

      I don't but only because the model is not satisfying, not because I dislike Tesla

    • galaxy_gas 6 hours ago ago

      I have try it a few times in Copilot as code fast 1 because it was advertised. It has never correctly done something so far. Maybe because it's the fast ver ?

    • YetAnotherNick 6 hours ago ago

      Grok fast is by far the most used model in openrouter with more than a trillion tokens weekly[1].

      [1]: https://openrouter.ai/rankings

      • behnamoh 5 hours ago ago

        Because some tools (AFAIR Kilo Code but I might be wrong) gave it away for free. The model itself was (still is?) free for a while, so I'm not surprised.

        • ribelo 2 hours ago ago

          Openrouter is not counting tokens used by Kilo or Cline. They have own endpoints.

          • wqaatwt 2 hours ago ago

            Yet if you go to the actual model’s page:

            https://openrouter.ai/x-ai/grok-code-fast-1

            Cline and Kilo code are in the top 3. So how does that work?

            It’s considerably cheaper than competing models like 2.5 flash, though. So its not that surprising

    • chistev 4 hours ago ago

      What models are better than Grok?

      • dymk 3 hours ago ago

        Sonnet-4 and onward, GPT-4 and onward

    • roman_soldier an hour ago ago

      At least Elon is open about what he believes. Other CEO's hide behind corporate PR machines, how do you know they are not psychopaths.

    • Void_ 5 hours ago ago

      Half of USA voted for Trump. That should answer “who actually uses Grok”.

      I personally use the best tool for the job, which Grok sometimes is.

      • aaronbrethorst 2 hours ago ago

        Trump received 77.3 million votes. Harris received 75 million votes. The US population is about 342 million.

        • herbst 2 hours ago ago

          I am not sure why these numbers would matter. He won, obviously, because the majority of voters voted for him.

          Which are Americans, Americans who either voted for him and didn't do enough against him.

          There is really no excuse to democratically vote for a person like this and let all this bullshit happen.

    • sipsi 6 hours ago ago

      i didn't

    • jacquesm 6 hours ago ago

      Bluntly: you couldn't pay me to use it.

  • ronsor 5 hours ago ago

    This post really has no reason to be flagged. I know Elon is controversial, and I have a lot of gripes with his business practices myself, but this is literally just documentation for a frontier LLM. Can we stay on topic?

    • ergocoder 3 hours ago ago

      Here are the 5 steps of denial:

      1. It's not better.

      2. It's better but it doesn't matter.

      3. It matters but people wouldn't use it.

      4. People use it but I wouldn't use it.

      5. Ok, I use it but you sir are racist!

      We are at around number 2 and 3.

    • big-and-small 4 hours ago ago

      This. I wouldn't pay to use it, but big context windows are amazing for programming and especially prototyping when you can keep whole codebase in context.

      Gemini's 1M is amazing.

  • raincole 5 hours ago ago

    It's funny how fast this post is flagged, lol. Have other LLMs or blunt ads got the same treatment on HN?

    • hereme888 5 hours ago ago

      It's probably because lots of people here resent their difference in personal ideology with Elon Musk.

      • jauntywundrkind 5 hours ago ago

        I'd bet 200% the opposite. That the forces & believers of Musk all 400% know that any discussion of Musk is going to look awful for him.

        People who flag don't do it because they don't want to dig in. They are almost universally a force for suppression & ignorance, the billionaire imperialist fatcat friend who is desperate to minimize the public eye.

  • johnnyApplePRNG 5 hours ago ago

    But for some reason if I load a 400kb file into it... it can't even read the file?! Pffft, whatever elon. Go play with your rockets.

  • ml-anon 2 hours ago ago

    Who gives a shit?

    • ribelo an hour ago ago

      I give a shit, and I use it every fucking day.

  • straydusk 5 hours ago ago

    Grok, no matter how good the technology, is just tainted by Elon. It's sad.

    • snthpy 2 hours ago ago

      Yeah, same for OpenAI because of Sama. I'm proud to say I haven't touched either for over a year. There are enough good alternatives out there.

    • kburman 2 hours ago ago

      Not defending anyone, but by that logic, you shouldn’t be using any Chinese models either.

      • jasonsb an hour ago ago

        I would argue that an open enemy of democracy (China) is a recognizable threat, but a false friend (Elon) who undermines it from within is far more dangerous.

      • wewtyflakes 2 hours ago ago

        Yes, and do you believe they are?

      • snthpy 2 hours ago ago

        Why is that? Does Chinese company really equal Chinese government?

        • legacynl an hour ago ago

          Basically yes. China doesn't have a democracy, and it's government isn't bound by it's laws. If CCP thinks deepseek or any other product/tech can be a beneficial to Chinese strategy they will come knocking, and there's no denying whatever they demand. It can be backdooring, data harvesting, etc, there's really no saying how far they might go.

          • norman784 an hour ago ago

            The same could be said of any LLM offered by either Chinese, European, US, etc.

          • sureglymop an hour ago ago

            On the other hand at least you can self host their models. My university now has an inference cluster for students and faculty to use open source models.

          • free_bip an hour ago ago

            Maybe if you're using their site directly, but what about the open models?

            • Yoric an hour ago ago

              Well, not using the site probably means that you're avoiding the mini-LLMs powdered before and after the main LLM to provide filters (including some layers of censorship) and the system prompt.

              So I guess it depends on how deep the bias sits. And that is something that may vary with time. Grok has been a good example of this, with the bias initially being introduced as system prompts, then apparently moved to synthetic data used to train the further generations of Grok.

          • snthpy an hour ago ago

            Ok, good points. Thanks

        • nurettin an hour ago ago

          Probably, as much as US company equals US government.

        • retinaros 2 hours ago ago

          lol. is that really a question? even for american companies look who's at the board of those companies...

          • snthpy an hour ago ago

            Fair enough. I'm just sick of the reflexive anti-Chinese hysteria. I wouldn't want to live there personally and condemn the human rights abuses as much as the next guy. However in international politics it's clear who the two largest terrorist regimes have been over the last fifty years and yet they're still somehow held up as the good guys.

      • alpineman 2 hours ago ago

        At least the Chinese models are open source, so you don't need to send money to the Chinese government to use them (unlike Grok 4, where you need to send money to Elon Musk)

        • kburman an hour ago ago

          “Open source” doesn’t mean “independent.” Most of those labs are state-linked and operate under laws that require compliance with party policy.

          The CCP plays a long game, they want dependency, not donations. Once enough people adopt their stack, they’ll set the governance norms and compliance rules around it.

          It’s not paranoia, it’s policy. Go read their New Generation AI Development Plan, they’ve been explicit about it since 2017.

          • Yoric an hour ago ago

            I agree with you. However, open weights (please let's not call these "open source", they are essentially binary blobs) are easier to fine-tune.

      • curiousgal an hour ago ago

        If I had to pick between a Chinese model and an American model based on the country's politics it would be China every time.

        • snthpy an hour ago ago

          I wouldn't go quite as far but overall i agree

        • aydyn 24 minutes ago ago

          cringe european jealousy

      • littlestymaar an hour ago ago

        True, though the the position of the CCP on Falun gong or Tiananmen square protests are much less likely to impact the life of a westerner than those of Elon.

      • NaomiLehman an hour ago ago

        or American, using that logic

      • XorNot 27 minutes ago ago

        I mean I don't, so...what's your point?

      • roman_soldier an hour ago ago

        Or OpenAI given Sam Altman's history (actual wickedness vs Elon's awkward salute). Just look up his sister and that whistleblower from OpenAI that was allegedly killed. There are numerous images of Democrat leaders giving what look like Nazi salutes, but no one clutches their pearls at that.