Hello All,
New to LW and still reading through the intro material and getting a hang of the place. I am ashamed to admit I found this place through Reddit - ashamed because I despise Reddit and other social media.
I came here because I cannot find a place to engage in long form discussions about ideas contrary to my own. I dream of a free speech platform where only form is policed, not content. Allowing any idea to be voiced no matter how fringe as long as it adheres to agreed upon epistemic standards.
Anyways, I know LW probably is not that place but it is adjacent. It seems most people here want to discuss AI research but hoping to find some communities outside of that topic.
Hello and welcome! There's a few of us around who discuss things other than AI research, myself among them. I suggest looking at the filtering options for the front page; it's the gear next to Latest, Enriched, Recommended, and Bookmarks. I filter the AI tag pretty heavily down.
If you want to lean into voicing fringe ideas around here, I'd suggest reading the LessWrong Political Prerequisites and maybe Basics of Rationalist Discourse. They're not universally agreed upon, but I think they do make for a decent pointer to the local standards.
Are you familiar with Astral Codex Ten (also called ACX)? The people there are also mostly smart, the rules of discussion in Open Threads are more relaxed... which can be a good thing or a bad thing, depends.
In case folks missed it, the Unofficial LessWrong Community Census is underway. I'd appreciate if you'd click through, perhaps take a survey, and help my quest for truth- specifically, truth about what the demographics of the website userbase looks like, what rationality skills people have, whether Zvi or Gwern would win in a fight, and many other questions! Possibly too many questions, but don't worry, there's a question about whether there's too many questions. Sadly there's not a question about whether there's too many questions about whether there's too many questions (yet, growth mindset) so those of you looking to maximize your recursion points will have to find other surveys.
If you're wondering what happens to the data, I use it for results posts like this one.
Heads up, I'm planning to close the census sometime tomorrow. You can take it here if you haven't yet!
Hi all! I'm a long-time LWer, but I'm making a comment thread here so that my research fellows can introduce themselves under it!
For the past year or so I've been running the Dovetail research fellowship in agent foundations with @Alfred Harwood. We like to have our fellows make LW posts about what they worked on during the fellowship, and everyone needs a bit of karma to get started. Here's a place to do that!
Hi everyone!
I'm Santiago Cifuentes, and I've been a Dovetail Fellow since November 2025 working on Agentic Foundations. My current research project consists in extending previous results that aim to characterize which agents contain world models (such as https://arxiv.org/pdf/2506.01622). On a similar line, I would like to provide a more general definition of what a world model is!
I've been silently lurking LessWrong since 2023, and I came across the forum while looking for rationality content (and in particular I found The Sequences quite revealing). I am looking forward to contribute to the discussion!
Hi everyone!
I am Margot Stakenborg, and I have worked with Dovetail in this winter fellowship cohort. I have a background in theoretical physics and philosophy of physics, and now making a switch into conceptual mechinterp, after having been interested in it and learning about it for some years. I have been working with Dovetail on formalising world models, I am writing up a sequence of posts on the philosophical and mathematical prerequisites for proper world models, and which tools from physics can help us understand and analyse different world models, and I will dive into the different definitions of "world model" that float around in mechinterp and AI safety literature. Things I will discuss are:
I hope to build this out into a quite comprehensive and complete sequence. Do let me know if there are other questions or subjects you would be interested in to read about!
Hi, I’m Vardhan, one of the Dovetail fellows this winter. Thanks Alex & Alfred for running this!
Background: I study mathematics and computer science (probability, algorithms, game theory) and I’m interested in formal models of agents and multi-agent interaction.
For the fellowship, I looked at the question: Which agents can be faithfully described by finite automata / finite transducers, and which structural properties make that more or less likely? In other words, when can an agent’s externally observable behavior be captured by a finite (possibly stochastic) automaton, and what observable signatures indicate that a finite-state model is impossible or misleading?
I’ve written a brief report summarizing definitions, toy examples, and some light lemmas. I’m planning a longer post with formal definitions, more examples, and proofs. I’d really appreciate recommendations on literature I may have missed (especially anything linking automata/dynamical-systems perspectives to algorithmic information theory, ergodic theory, or learning theory). Comments, questions, and pointers very welcome!
Hi! I'm very new to LW.
I found this website while searching up philosophy websites that are useful. I've been looking around LW for about a week now, just reading and learning peoples takes. There's a lot of it and it's great if you ask me.
I'm still learning the guidelines and the karma system, which had been a little intimidating, but I'm getting the hang of it now. I do recognise that LW is more professional than I originally thought, especially professional for my age, but it's not like I'm applying to work for Nasa or anything.
That's just me, though. I would greatly appreciate any tips for navigating, filtering content, etc.
A good resource to get familiar with the basics of LW approach to life, universe, and everything is https://www.readthesequences.com/
I feel like the react buttons are cluttering up the UI and distracting. Maybe they should be e.g., restricted to users with 100+ karma and everyone gets only one react a day or something?
Like they are really annoying when reading articles like this one.
Yeah, I agree with this. I think they are generally decent on comments, but some users really spam them on posts. It’s on my list to improve the UI for that.
Seems like a signal-to-noise problem. Some amount seems like a useful signal, but too much is too hard to digest. Privileges based on karma make some sense but restricting it based on time (1/day/user or something) seems pretty crude, so I don't like that idea.
Not sure if this is a good idea either, but the number of reacts allowed per post could be based on the amount of karma that user generated on comments on that post. That way, a user who's doing too many reacts would be encouraged to just write a comment instead. That still doesn't seem like exactly the right incentive, but I'm also not sure how I want it to work.
Maybe the ability to filter out reacts from a particular (prolific) user would suffice?
Yeah I would like to mute some users site-wide so that I never see reacts from them & their comments are hidden by default....
Do you have any thoughts on those UI improvement written down anywhere?
I'll admit to being one of the users that really spams reactions on posts. I like them as a form of highlighting for review and as a form of backchannel communication. I would be much happier if people would use more reacts towards me. So I would be upset with UI modifications to restrict reacts, but fully support updates to make the UI around viewing reacts cleaner and more useful.
I wrote a longer comment with some feature suggestions. If you have time it would be nice to hear your thoughts.
Part of it is the “vulnerability” where any one user can create arbitrary amounts of reacts, which I agree is cluttering and distracting. Limiting reacts per day seems reasonable (I don’t know if 1 is the right number, but it might be, I don’t recall ever react-ing more than once a day myself). Another option (more labor-intensive) would be for mods to check the statistics and talk to outliers (like @TristanTrim) who use way way more reacts than average.
[EDIT: I think issues stem from different people using reacts in different ways and having different assumptions about their use. I think I am probably using them in a less common way than other people, but I also find myself believing I am using them in a better way than other people. As such, I am trying to put in effort to communicate my POV. I would appreciate if anyone who disagrees with me would do so with a higher bandwidth signal than just pressing the "Agreement: Downvote" button. Perhaps by using some inline reacts on my comment?]
Haha! Sorry if I'm bothering anyone! ☺♡
I really like reacts and am bothered in essentially the opposite direction as Sodium in that I think reacts are a very useful backchannel communication, and see it as a minor moral failing that most users do not use them more.
I think it's great that many reacts are based on LW ideals for discourse. I don't know exactly how they are managed, but I think they could be even more valuable if there was some team that reviewed how people are currently using them and then improved and updated react descriptions and usage guides based on that. A descriptivist approach.
I also think a prescriptive approach would also be good. People should be suggesting concepts for reacts that they think would be valuable for communication, and people should be figuring out how to promote proper use of reacts.
I do agree that relevance may be an issue. I would like it if everyone would drop ~10 reacts while reading a post, but then, if all of them showed in the UI, it would be too noisy to make sense of easily. I think there are a few ways around this:
Another issue, I don't know if this is the case or not, but if each react on your comment or post shows up as it's own entry in the notifications list, then that would be annoying because it would make it hard to see the more important notifications. So reacts should probably be batched like karma is somehow. (And really, I think a bunch of improvements could be made to the notifications UI.)
All that said, I strongly oppose restricting who can use reacts and how many reacts they can use. Rather, more people should be encouraged to use more reacts more competently and the UI for viewing / ignoring reacts should be improved.
My two cents, I'm happy with the amount of reacts I usually see and would probably enjoy about 20% more.
Thank you for chipping in your two cents!
I use the "typo" reaction and hope it is useful for authors, but I don't ever go back to remove it if the typo has been corrected. I'm not even sure what happens in that case.
We recently made it so that authors can remove typo reacts themselves. It’s still a bit annoying, but it’s less annoying than before!
Hello,
I'm very happy to be here!
Unfortunately I'm only just bringing LessWrong into my life and I do consider that a missed opportunity. I wish I had found this site many years ago though that could have been dangerous as this could be a rabbit hole I might have found challenging to escape, but how bad would that have actually been? I'm sure my wife would not have been thrilled. My reason for coming here now unfortunately, especially at this point in time, is very unoriginal. In the last eight months I've taken what was a technology career possibly in its waning years, into a new world of wonder and exploration, and yes I'm talking about AI. I've been in technology for over 30 years and certainly have paid a little bit of attention to machine learning and AI over this time span but somehow just kind of missed what was really going on in the last two years. I think I was overwhelmed by the level of hype that I was running into and how shallow it often seemed talking about magical prompts that would give you miraculous results and I just assumed that things weren't really in a very good space. Yet I was very wrong and I'm glad I didn't wait even longer to discover the true state of things, though not all of it is good.
I've been working for 6 months using AI all day long at my day job, using Claude Code and many other tools doing development and platform engineering work. It's really been in the last a couple months that I've started to look more seriously what I found compelling in the world of AI and I kept coming back to one of my earliest observations formed during my early re-engagement of AI this year. That was an instinct that hit me right away after discovering what the new world of LLMs had to offer and that was that they were very clearly to me fundamentally flawed this wasn't based on any deep understanding of the training process of how LLMs work, though it was reinforced based on my expanding understanding of this subject. It first started as I did extensive experiments in my use of AI to do work. I'll cut to the chase and just state that it seemed clear to me that it was highly unlikely that LLM's were going to lead to AGI, or at least as I view it.
Learning and knowledge has always been a very dear and important topic for me. I have never stopped picking apart my understanding and model of how learning works, at least for myself, and what makes the process more constructive, healthy, and valid. In reading some of the Sequences, though I have just barely scratched the surface, it is clear this is community I'm excited to have discovered and one I'm looking forward to participating in. While I easily accept and can be content at a new AI carrier that mostly involves development and engineering in the world of LLM's, my real interest lies in trying to imagine explore the space of what in my mind would have an actual chance at achieving AGI. I'm not interested in just building towards a challenge, this point is relevant as I started to think building something to match against ARC-AGI would be a great way to learn and explore, I'm more interested in trying to work out an idea of how an AI model could not only do real learning, reaching actual comprehension, but is capable of building its own world model, one distilled nugget of understanding at a time.
One goal of this work was formulate this vision mostly in isolation as a great way to really stretch my mind and see where I could go on my own. I digress, but this is the direction that led me here. I was talking to a few people at a local AGI event and they recommended that my first article on my vision would be ideal for LessWrong.
I while I'm still days from having that article ready, I had an experience this morning that inspired me to write a quick article that seemed like a good first post for this site. I made sure I digested the guidelines, especially the one on LLM generated content. I do most of my writing that involves bring lots of pieces together with the aid of AI, mostly to help organize, make larger edits, and to help me analyze my own writing. That was the case with the piece I wrote today and posted here. It was rejected, and while I have nothing at all critical to say of the reviewer, especially considering the work load that must be present these day, the main stated reason was the LLM policy. Put simply, this work was my content and words. I just copied the everything in this comment other than this last bit into JustDone and it declared that it was 99% AI content. I wrote every word of this in real time in the comment box of this page. While I can make no claim to understand the process the moderator used to make their determination, I hope to get this figured out before I am ready to post my piece on distillation of knowledge into a world model. I fear that an old wordy and writer like myself often sounds more like an AI than a modern human. :-)
Sorry for the overly wordy first post, but I look forward to interacting and collaborating in the future!
Seems like JustDone gives abnormally high AI content estimations. Plausibly this is to scare you into using their "text humanizer" in which an AI re-writes what you wrote to make it seem less like an AI to an AI... I weep for humanity.
I'd recommend reading and commenting until you have enough karma to submit your post to the LW editor who can more straightforwardly tell you why your post would or wouldn't be rejected.
PS: I would like to encourage you, like everyone, to stop focusing on AI capabilities and instead focus on AI interpretability and preference encoding.
I'm curious: what percent of upvotes are strong upvotes? What percent of karma comes from strong upvotes?
Here's the tally of each kind of vote:
Weak Upvote 3834911
Strong Upvote 369901
Weak Downvote 426706
Strong Downvote 43683And here's my estimate of the total karma moved for each type:
Weak Upvote 5350471
Strong Upvote 1581885
Weak Downvote 641568
Strong Downvote 206491The mods may have better overall data, but personally, I weak vote a lot more than I strong vote, and I don't vote on everything I read either.
Hello! I chose the name “derfriede” for LW. This is my first post here, which I am happy about. I have read some of the introductory materials and am very interested.
What interests me? First of all, I want to explore the topic of AI and photography. I study the theory and philosophy of photography, look for new approaches, and try to apply a wide variety of perspectives. I think it's useful to address the question of what AI cannot do. It's very similar to researching glitch culture. Okay, I'll stop here for now, because I just want to get acquainted.
Have a nice day, wherever you are!
I'm sure that hobbyists on Civitai or TensorArt have some thoughts on it. Many LoRAs are made to evoke antiquated camera technologies, digital and analog (although they often incorporate elements of what we may call 'art direction' like costume and furnishing of spaces to match the formats).
I think most people aren't aware of how much AI there already is, and has been, in their smartphone and the influence that has on their photos.
Welcome! The only thing I can think of on the intersection of AI and photography (besides IG filters) is this weird "camera", which uses AI to turn a little bit of geographical information to create images. Do you know of any other interesting intersections?
I have some time on my hands and would be interested in doing something meaningful with it. Ideally learn / research about AI alignment or related topics. Dunno where to start though, beyond just reading posts. Anyone got pointers? Got a background in theoretical / computational physics, and I know my way around the scientific Python stack.
AI alignment has been getting so much bigger as a field! It's encouraging, but we still have a long way to go imo.
Did you see Shallow review of technical AI safety, 2025? I'd recomment looking through that post or their shallow review website and finding something that seems interesting and starting there. Each sub-domain has its own set of jargon and assumptions so I wouldn't worry too much about trying to learn the foundations since we don't have a common set of foundations yet.
Just reading posts isn't bad, but since there isn't that common set of foundations, it could be confusing when you're just starting out (or even when you're quite experienced).
Good luck and glad to have you!
Hi everyone!
New to LW. Recently I've been interested in AI research, especially mech interp, and this seems to be the place that people go to discuss this. I studied philosophy in undergrad and while since then I've gotten interested in CS and math, my predilections still tend toward the humanities side of things. Will mostly be lurking at first as I read through The Sequences and get used to the community norms here, but hope to share some of my independent research soon!
Hello, I am an entity interested in mathematics! I'm interested in many of the topics common to LessWrong, like AI and decision theory. I would be interested in discussing these things in the anomalously civil environment which is LessWrong, and I am curious to find out how they might interface with the more continuous areas of mathematics I find familiar. I am also interested in how to correctly understand reality and rationality.
Hi!
What sorts of mathematics are you interested in? I'm interested in topology and manifolds which I hope to apply to understanding the semantics of latent spaces within neural networks, especially the residual stream of transformers. I'm also interested in linear algebra for the same reason. I would like to learn more about category theory, because it seems interesting. Finally, I like probability theory and statistics because, like you, I'd like to "correctly understand reality and rationality".
Hi. I am interested in much of the mathematics which underlies theories of physics, such as complex analysis, as well as most of mathematics, although I sadly do not have the capacity to learn about the majority of it. Your interests seem interesting to me, but I do not understand enough about AI to know exactly what you mean. What is the residual stream of a transformer?
I sadly do not have the capacity to learn about the majority of it.
Sadly, it's a problem you share with me and most humans, I think, with possible rare exceptions like Paul Erdős.
I'll try to build up a quick sketch of what the residual stream is, forgive me if I say things that are basic, obtuse, or slightly wrong for brevity.
All neural networks (NN) are built using linear transformations/maps which in NN jargon are called "weights" and non-linear maps called "activation functions". The output the activation functions are called "activations". There are also special kinds of maps and operations depending on the "architecture" of the NN (eg: convNet, resNet, LSTM, Transformer).
A vanilla NN is just a series of "layers" consisting of a linear map and then an activation function.
The activation functions are not complicated nonlinear maps, but quite simple to understand. One of the most common, ReLu, can be understood as "for all vectors, leave positive components alone, set negative components to 0" or "project all negative orthants onto the 0 hyperplane". So, since most of the complex behaviour of NNs is coming from the interplay of the linear maps and these simple nonlinear maps, so linear algebra is a very foundational tool for understanding them.
The transformer architecture is the fanciest new architecture that forms the foundation of modern LLMs which act as the "general pretrained network" for products such as chat-GPT. The architecture is set up with a series of "transformer blocks" each of which has a stack of "attention heads" which is still matrix transformations but set up in a special way, and then a vanilla NN.
The output of each transformer block is summed with the input to use as the input for the next transformer block. The input is called a "residual" from the terminology of resNets. So the transformer block can be thought of as "reading from" and "writing to" a "stream" of residuals passed along from one transformer block to the next like widgets on a conveyor belt, each worker doing their one operation and then letting the widget pass to the next worker.
For a language model, the input to the first transformer block is a sequence of token embeddings representing some sequence of natural language text. The output of the last transformer block is a sequence of predictions for what the next token will be based on the previous ones. So I imagine the residual stream as a high dimensional semantic space, with each transformer block making linear transformations and limited nonlinear transformations to that space to take the semantics from "sequence of words" to "likely next word".
I am interested in understanding those semantic spaces and think linear algebra, topology, and manifolds are probably good perspectives.
Thanks for your clear explanation, understanding the topology of the space seems fascinating. If it's a vector space, I would assume its topology is simple, but I can see why you would be interested in the subspaces of it where meaningful information might actually be stored. I imagine that since topology is the most abstract form of geometry, the topological structure would represent some of the most abstract and general ideas the neural network thinks about.
Yeah! I think distance, direction, and position (not topology) are at least locally important in semantic spaces, if not globally important, but continuity and connectedness (yes topology) are probably important for understanding the different semantic regions, especially since so much of what neural nets seem to do is warping the spaces in a way that wouldn't change anything about them from a topological perspective!
subspaces of it where meaningful information might actually be stored
At least for vanilla networks, the input can be embedded into higher dimensions or projected into lower dimensions, so you're only ever really throwing away information, which I think is an interesting perspective for when thinking about the idea that meaningful information would be stored in different subspaces. It feels to me more like specific kinds of data points (inputs) which had specific locations in the input distribution would, if you projected their activation for some layer into some subspace, tell you something about that input. But whatever it tells you was in the semantic topology of the input distribution, it just needed to be transformed geometrically before you could do a simple projection to a subspace to see it.
Hello everyone,
Just a quick "Hi" and figured I'd intro myself as I'm new to this space.
As part of my new year's resolution to "do something different" this year (beyond the yearly failed attempt to exercise more, and eat/drink less) I thought that this is something I can achieve - and enjoy doing.
So let's see where to start?
I live in Canada, in my 5th decade, am a family man and work in computing. I in fact enjoy being proven wrong - as it helps to show I am still learning.
I enjoy long walks on the beach, and am at equally at home at the opera as I am at a baseball stadium .. wait .. sorry that was for the dating site ... don't tell my wife ;)
Jokes aside, looking forward to being a lurker!
Richard
I'm a bit confused about forecasting tournaments and would appreciate any comments:
Suppose you take part in such a tournament.
You could predict as accurately as you can and get a good score. But let's say there are some other equally good forecasters in the tournament and it becomes a random draw who wins. On expectation, all forecasters of the same quality have the same forecasts. If there are many good forecasters, your chances of winning become very low.
However, you could include some outlier predictions in your predictions. Then you lower your expected accuracy, but you also incrase your chances of winning the tournament if these outlier probabilities come true.
Therefore, I would expect a lot of noise in the relation between forecasting quality and being a tournament winner.
My knowledge level: I read the metaculus FAQ a couple days ago
At least on metaculus the prize pool is distributed among everyone with good enough accuracy, rather than winner-takes-all. So it shouldn't be affected by the (real) phenomenon that you are describing.
Thanks, good to know. So I assume there is an incentive difference between monetary incentives that can be distributed in such a way, and the incentive of being able to say that you won a tournament (maybe also as a job qualification).
Now that it is the New Year, I made a massive thread on twitter concerning a lot of my own opinionated takes on AI, which to summarize are my lengthening timelines, which correlates to my view that new paradigms for AI are likelier than they used to be and more necessary, which reduces AI safety from our vantage point in expectation, AI will be a bigger political issue than I used to think and depending on how robotics ends up, it might be the case that by 2030 LLMs are just good enough to control robots even if their time horizon for physical tasks is pretty terrible, because you don't need much long term planning, which would make AI concern/salience go way up, though contra the hopes of a lot of people in AI safety, this almost certainly doesn't let us reduce x-risk by much, for reasons Anton Leicht talks about here, and many more takes in the full thread above.
But to talk about some takes that didn't make it into the main Twitter thread, here are some to enjoy:
More generally, once you are able to go into space and create enough ships such that you can colonize solar systems/galaxies, your civilization is immune to existential threats that rely solely on our known physics, which is basically everything that isn't using stellar/galactic resources, and this vastly simplifies the coordination problems compared to coordination problems here on Earth.
I instead want space governance to be prioritized more for 2 reasons:
These are my takes for New Years today.
It would be nice to have a post time-sorted quick takes feed. https://www.lesswrong.com/quicktakes seems to be latest comment-sorted or magic sorted
Greetings, Claude sent me here! My goals are primarily self-improvement- I will appreciate engaging with individuals that are able and willing to inform me of weaknesses in my lines of thinking, whatever the topic. Lucky that this place exists. I miss the old internet when authentic honest material was more commonly found rather than ideologically skewed, bait, or persuasion, especially well-disguised persuasion. Basically, just a guy that feels half the internet is attempting to hijack my thoughts rather than present good faith information. Lucky to be here!
(Reposted from my shortform)
What coding prompt do you guys use? It seems exceedingly difficult to find good ones. GitHub is full of unmaintained & garbage awesome-prompts-123 repos. I would like to learn from other people's prompt to see what things AIs keep getting wrong and what tricks people use.
Here are mine for my specific Python FastAPI SQLAlchemy project. Some parts are AI generated, some are handwritten, should be pretty obvious. This is built iteratively whenever the AI repeated failed a type of task.
AGENTS.md
# Repository Guidelines
## Project Overview
This is a FastAPI backend for a peer review system in educational contexts, managing courses, assignments, student allocations, rubrics, and peer reviews. The application uses SQLAlchemy ORM with a PostgreSQL database, following Domain-Driven Design principles with aggregate patterns. Core domain entities include Course, Section, Assignment, Allocation (peer review assignments), Review, and Rubric with associated items.
This project is pre-alpha, backwards compatibility is unimportant.
## General Principles
- Don't over-engineer a solution when a simple one is possible. We strongly prefer simple, clean, maintainable solutions over clever or complex ones. Readability and maintainability are primary concerns, even at the cost of conciseness or performance.
- If you want exception to ANY rule, YOU MUST STOP and get explicit permission from the user first. BREAKING THE LETTER OR SPIRIT OF THE RULES IS FAILURE.
- Work hard to reduce code duplication, even if the refactoring takes extra effort. This includes trying to locate the "right" place for shared code (e.g., utility modules, base classes, mixins, etc.), don't blindly add the helpers to the current module.
- Use Domain-Driven Design principles where applicable.
## SQLAlchemy Aggregate Pattern
We use a parent-driven (inverse) style for DDD aggregates where child entities cannot be constructed with a parent reference.
**Rules:**
- Child→parent relationships must have `init=False` (e.g., `Allocation.assignment`, `Review.assignment`, `RubricItem.rubric`, `Section.course`)
- Parent→child collections must have `cascade="all, delete-orphan", single_parent=True, passive_deletes=True`
- Always use explicit `parent.children.append(child)` after creating the child entity
- Never pass the parent as a constructor argument: `Child(parent=parent)` ❌ → `child = Child(); parent.children.append(child)` ✅
Additional rules (aggregate-root enforcement):
- Never manually assign parent foreign keys (e.g., `child.parent_id = parent.id`).
- Do not perform cross-parent validations inside child methods.
- Let SQLAlchemy set foreign keys via relationship management (append child to parent collection).
- Enforce all aggregate invariants at the aggregate root using object-graph checks (e.g., `section in course.sections`).
Service layer patterns:
- **Mutations** (create, update, delete): Always return the aggregate root.
- **Queries** (get, list): May return child entities directly for convenience, especially when the caller needs to access a specific child by ID.
## Code Style
- 120-character lines
- Type hint is a must, even for tests and fixtures!
- **Don't use Python 3.8 typings**: Never import `List`, `Tuple` or other deprecated classes from `typing`, use `list`, `tuple` etc. instead, or import from `collections.abc`
- Do not use `from __future__ import annotations`, use forward references in type hints instead.
- `TYPE_CHECKING` should be used only for imports that would cause circular dependencies. If you really need to use it, then you should import the submodule, not the symbol directly, and the actual usages of the imported symbols must be a fully specified forward reference string (e.g. `a.b.C` rather than just `C`.)
- Strongly prefer organizing hardcoded values as constants at the top of the file rather than scattering them throughout the code.
- Always import at the top of the file, unless you have a very good reason. (Hey Claude Opus, this is very important!)
## Route Logging Policy
- FastAPI route handlers only log when translating an exception into an HTTP 5xx response. Use `logger.exception` so the stack trace is captured.
- Never log when returning 4xx-class responses from routes; those are user or client errors and can be diagnosed from the response body and status code alone.
- Additional logging inside services or infrastructure layers is fine when it adds context, but avoid duplicating the same exception in multiple places.
**Why?**
- 5xx responses indicate a server bug or dependency failure, so capturing a single structured log entry with the traceback keeps observability noise-free while still preserving root-cause evidence.
- Omitting logs for expected 4xx flows prevents log pollution and keeps sensitive user input (which often appears in 4xx scenarios) out of centralized logging systems.
- Using `logger.exception` standardizes the output format and guarantees stack traces are emitted regardless of the specific route module.
### Using deal
We only use the exception handling features of deal. Use @deal.raises to document expected exceptions for functions/methods. Do not use preconditions/postconditions/invariants.
Additionally, we assume `AssertionError` is never raised, so @deal.raises(AssertionError) is not allowed.
Use the exception hierarchy defined in exceptions.py for domain and business logic errors. For Pydantic validators, continue using `ValueError`.
## Documentation and Comments
Add code comments sparingly. Focus on why something is done, especially for complex logic, rather than what is done. Only add high-value comments if necessary for clarity or if requested by the user. Do not edit comments that are separate from the code you are changing. NEVER talk to the user or describe your changes through comments.
### Google-style docstrings
Use Google-style docstrings for all public or private functions, methods, classes, and modules.
For functions (excluding FastAPI routes), always include the "Args" sections unless it has no arguments. Include "Raises" if anything is raised. Include "Returns" if it returns a complex type that is not obvious from the function signature. Optionally include an "Examples" section for complex functions.
FastAPI Routes: Use concise summary docstrings that describe the business logic and purpose. Omit Args/Raises/Returns sections since these are documented via decorators (response_model, responses), type hints, and Pydantic models. The docstring may appear in generated API documentation.
For classes, include an "Attributes:" section if the class has attributes. Additionally, put each attribute's description in the "docstring" of the attribute itself. For dataclasses, this is a triple-quoted string right after the field definition. For normal classes, this is a triple-quoted string in either the class body or the first appearance of the attribute in the \_\_init\_\_ method, depending on where the attribute is defined.
For modules, include a brief description at the top.
Additionally, for module-level constants, include a brief description right after the constant definition.
### Using a new environmental variable
When using a new environmental variable, add it to .env.example with a placeholder value, and optionally a comment describing its purpose. Also add it to the `Environment Variables` section in `README.md`.
## Testing Guidelines
Tests are required for all new features and bug fixes. Tests should be written using `pytest`. Unless the user explicitly request to not add tests, you must add them.
More detailed testing guidelines can be found in [tests/AGENTS.md](tests/AGENTS.md).
## GitHub Actions & CI/CD
- When adding or changing GitHub Actions, always search online for the newest version and use the commit hash instead of version tags for security and immutability. (Use `gh` CLI to find the commit hash, searching won't give you helpful results.)
## Commit & Pull Requests
- Messages: imperative, concise, scoped (e.g., “Add health check endpoint”). Include extended description if necessary explaining why the change was made.
## Information
Finding dependencies: we use `pyproject.toml`, not `requirements.txt`. Use `uv add <package>` to add new dependencies.
tests/AGENTS.md
# Testing Guidelines
Mocking is heavily discouraged. Use test databases, test files, and other real resources instead of mocks wherever possible.
### Running Tests
Use `uv run pytest ...` instead of simply `pytest ...` so that the virtual environment is activated for you.
By default, slow and docker tests are skipped. To run them, use `uv run pytest -m "slow or docker"`.
## Writing Tests
When you are writing tests, it is likely that you will need to iterate a few times to get them right. Please triple check before doing this:
1. Write a test
2. Run it and see it fail
3. **Change the test itself** to make it pass
There is a chance that the test itself is wrong, yes. But there is also a chance that the code being tested is wrong. You should carefully consider whether the code being tested is actually correct before changing the test to make it pass.
### Writing Fixtures
Put fixtures in `tests/conftest.py` or `tests/fixtures/` if there are many. Do not put them in individual test files unless they are very specific to that file.
### Markers
Allowed pytest markers:
- @pytest.mark.slow
- @pytest.mark.docker
- @pytest.mark.flaky
- builtin ones like `skip`, `xfail`, `parametrize`, etc.
We do not use
- @pytest.mark.unit: all tests are unit tests by default
- @pytest.mark.integration: integration tests are run by default too, no need to mark them specially. Use the `slow` or `docker` markers if needed.
- @pytest.mark.asyncio: we use `pytest-asyncio` which automatically handles async tests
- @pytest.mark.anyio: we do not use `anyio`
## Editing Tests
### Progressive Enhancement of Tests
We have some modern patterns that are not yet used everywhere in the test suite. When you are editing an existing test, consider updating it to use these patterns.
1. If the test creates sample data directly, change it to use factory functions or classes from `tests/testkit/factories.py`.
2. If the test depends on multiple services, change it to use the `test_context` fixture. This is an object that contains clients for all services, and handles setup and teardown for you, with utility methods to make common tasks easier.
3. We are migrating from using individual `shared_..._service` fixtures (e.g., `shared_assignment_service`, `shared_user_service`) to the `test_context` fixture. When editing tests that use these, please refactor them to use `test_context` instead.
4. Integration tests are being refactored to use service-layer setup (`db_test_context`) instead of verbose API calls for prerequisites. This reduces setup code from ~15-30 lines to ~3-5 lines, making tests faster and more focused on testing actual API behavior rather than setup logic.
**Example**:
```python
# OLD: Verbose API setup
course_response = await authenticated_client.post("/courses", json={"name": "Test"})
course_id = uuid.UUID(course_response.json()["id"])
rubric_id = await _create_rubric(authenticated_client, course_id)
assignment = await authenticated_client.create_assignment(course_id, rubric_id=rubric_id)
# NEW: Clean service-layer setup
course = await db_test_context.create_course(name="Test")
rubric = await db_test_context.create_rubric(course_id=course.id)
assignment = await authenticated_client.create_assignment(course.id, rubric_id=rubric.id)
```
## Patterns for Common Testing Scenarios
### Sample Data Creation
Use factory functions or classes to create sample data for tests, these are located in `tests/testkit/factories.py`. Avoid duplicating sample data creation logic across tests.
(We are in the process of migrating to factory functions/classes, so you may still see some tests creating sample data directly. Please use the factories for any tests you write or update.)
### Testing the FastAPI Application
The FastAPI application can be imported as a default instance or created via factory function.
- Use the default `app` instance is the preferred approach for most tests
- Use the `create_app()` factory when testing scenarios where app configuration is what you're testing
(I also collected a couple other prompts here but it takes too much screen estate if I repost everything)
Hi everyone,
I've read many of the posts here over the years. A lot of the ideas I first met here seem to be coming up again in my work now. I think the most important work in the world today is figuring out how to make sure AI continues to be something we control, and I find most of the people I meet in SF still think AI safety means not having a model say something in publc that harms a corporate brand.
I'm here to learn and bounce some ideas off of people who are comfortable with Bayesian reasoning and rational discussion, and interested in similar topics.
I'm a programmer by trade, and got serious about understanding AI and ML while working on a semi-supervised data labeling product (similar to Snorkel). That let me back to linear algebra, probability theory and all the rest.
I'm starting to explore AI alignment, and this seemed like a good forum to start reading and thinking more about it. The site still feels a little daunting, but I'm sure I'll get the hang of it eventually. Let me know if there are any posts you love and I'll check them out!
Hello.
My interests are transformer architecture and where it breaks.
Extending transformers toward System-2 behavior.
Context primacy over semantics.
I’m focused on the return to symbolics.
On the manifold hypothesis, and how real systems falsify it.
Inference, finite precision, discrete hardware.
Broken latent space, not smooth geometry.
I’m interested in mechanistic interpretability after the manifold assumption fails.
What survives when geometry doesn’t.
What replaces it.
I’m also seeking advice on intellectual property.
I’m here to find others thinking along these lines.
Interesting. Some thoughts:
If it’s worth saying, but not worth its own post, here's a place to put it.
If you are new to LessWrong, here's the place to introduce yourself. Personal stories, anecdotes, or just general comments on how you found us and what you hope to get from the site and community are invited. This is also the place to discuss feature requests and other ideas you have for the site, if you don't want to write a full top-level post.
If you're new to the community, you can start reading the Highlights from the Sequences, a collection of posts about the core ideas of LessWrong.
If you want to explore the community more, I recommend reading the Library, checking recent Curated posts, seeing if there are any meetups in your area, and checking out the Getting Started section of the LessWrong FAQ. If you want to orient to the content on the site, you can also check out the Concepts section.
The Open Thread tag is here. The Open Thread sequence is here.