Okay, so hi everyone. My name is Ming-Fang and I'm currently an engineer at Facebook. And the title of my talk for today is Deep Dying to Relay Store. And so Relay is a library from Facebook, which helps you when you're writing on web apps and you need something to manage your data for you. And especially if you have worked with something in a React wall before, like React, GraphQL stack, there's a chance that you might have heard about Relay. It's an open source framework by Facebook. And for anyone that is not familiar, I try to keep my talk on, I try to explain the concept on high-level notes. But yeah, so before I start my talk, I want to really thank the organizers. I think these are great initiatives to share juniors and juniors in Singapore. So something about myself, the guys in glasses on the left is me. This picture I took like a few months ago, but somehow the shirt is the same. And also the things on the rice, like what I have come up with in the past few months, I think I have to thank the circuit breaker period for vastly improving my cooking a lot. All right, so before like diving into the internal of Relay storage, let's look at the big pictures and see how this piece of software fit. So a few years ago in 2013, React released to help us like write web as easier. So it introduces concept of components. You can think of your apps as a list of components. And the framework will figure out how to make the changes, how to render the changes for you. And two years later, Facebook released another project called GraphQL. And this is useful if you model your database in a graph manner. It's a different approach to develop web API. And finally, we can see that actually there are some pieces missing in the middle. And now we have the back and the front end, but we are missing some glue code in between. The developers still need to write a code to manually fetch the data to store it in the client. And then he has to manage the consistency of the data himself. So in that light, the framework I'm talking about today was born. And it's called Relay. It's a connector between the React UI layer and the GraphQL layers. And it was released in the same year as the GraphQL. So what is Relay? And so in short, it's just like the management framework built exclusively for if you have a React apps and a GraphQL server setup. So keep in mind that Relay will not work with anything like anything you throw at that. So only if you have like a wrap-based server and using a front end in React. So it's in charge of, Relay is in charge of proving out what kind of data you need to fetch, managing the consistency, and then present that to the UI layer. And we're going to dive into that in a few coming slides. Oh, the big idea of Relay, you're familiar with the front end application is that data is the core of your apps. And Relay is really co-locate the data with the components. So in the example on the right, you can see that you are creating a post. Then you really need some title and description. And this data dependencies in Relay, you can specify it alongside the component itself. So it makes it pretty transparent on what kind of data it needs. And you can think of your apps, you can think in a localized manner when you try to reason about the logic of these components. And one of the benefits that this model brings is it can actually make you be able to refract the code with easier, with more confidence, making it move faster, because you can reason about the component in isolation instead of like as a whole, as a part of bigger apps. So this talk is about the Relay as a framework, but Relay itself is not huge, but it does have like multiple moving pieces. The first part is the compiler itself. The compiler is in charge of converting the data requirements into a more understandable format. So let's go back to the previous slide where you see that the thing in red, really just the data requirements for these components. But this format is not very helpful for the framework. So the compiler will try to convert it into some data structure that the framework can consume. The second part is the meat of the whole framework is the Relay runtime where it actually managed the data fetching, storing the data and managing the consistency. The final part is the React Relay layer where it provides some helpers for us to work with React apps. But for the purpose of today's talk, we are going just to look into the Relay runtime. And more specifically, we're just going to look at how the data is stored inside Relay. Right. So let's start with an example to understand Relay better. Let's say in 2020 we're going to create a new social network. And you're going to do that, then you might need something called Post. The Post component on its own, the UI looks like there are several parts to it. The good thing is that we can always divide and concur this into smaller components. So for example, on the top, you can have something like account sections, you have the user names. And in the middle, there's a post contents with some titles, some description, maybe some photos even. And finally, you have like the reaction sections where user can leave commands, share the post. And the great things about thinking of your UI as a component is that you can always do this like multiple times. So let's say the post content is quite big. You can really spit it out into multiple subcomponents like, for example, text description or the attachment. So you look at this as a whole. Each component has its own data requirements. And the data requirements for exceptions is very different. So if you organize your apps in React as a tree of components, then naturally, the data of your apps will more or less look like a tree's too. The good thing about Relays is that why you're able to declare the data dependency per the components, but Relays on its own is going to think at the aggregation level. It's going to think on the app level. And it tries to aggregate all the data dependency of these whole component trees and likely just make one query to the server instead of like issuing multiple queries. Comparing this with a more traditional Raspberry API approach, you might need to have like to render one post components. You might have like one query for users, one query for the content, and another query for the reactions. So that's going to be more latency to this. Another approach with Res API is that maybe you can combine these three APIs into one, but this approach is quite rigid because it's not scalable because there are a lot of ways you have to combine APIs depending on what kind of components you're having. So in Relay, all of these are automated and the developers really don't need to think about that. Okay, so let's look more into how the data is fetched from the server into the Relay Store. On the left-hand side, you have something, you have a web apps or mobile apps, which is powered by Relay. And in other core Relay is a store. We call it the Relay Store. And on the rise, you have a RAP based server and it's powered by RAPQL. And when your clients want to ask for some data, it's going to ask, it's going to send a description of what kind of data dependencies that it needs. So it can be a very, very nested structure or it can be just like a simple like a JSON, flattened JSON file. And the server is going to read that request, pass a request and look into its database and then return the clients with the data it needs in the form that the clients asked for. So this data will finally be stored inside the Relay Store. All right, so for the store, then you can think of the store as a client-side cache. And it is basically a smaller version of your database. It's called sub-crap your database, but it's stored in a normalized manner. Relay is going to do some processing steps before saving the data inside storage. Okay, so to understand how data is stored in Relay, we need to look into two main data structures. The first one for Relay is called the record. The record is just a single entities with like an ID, a type and some other fields. Among these, the most important fields are really the ID and the type. The type let Relay know what the type is and the ID has Relay to identify this unique record. And in Relay, one record can be linked to another record, for example. In this field, you have like a user, but he can have an address and address is another record that the user can link to. The second data type, and I promise you that's only two significant data types in Relay, which is the second one is called the record source. It's nothing but just a dictionary with the key as the ID of this record and the value is the record data itself. And in fact, the Relay Store itself is just a big dictionary, a big record source. And every data on the client side see in this big dictionary itself. This data structure has another significant in that because there can be changes to the data store. All the changes are made to the store are expressed in terms of the record source. So let's say you're fetching some new data or you're updating some data, the results will be normalized into this dictionary line structures before it is submitted to the data store. Okay, so I talked about consistency before in the client side. One of the decision Relay made is that it's going to be normalized. And so let's look at an example here, like on the left hand side, the payload is the payload you receive from the server for the users. It has like an ID, a name for the users, and some nested field like address. But this is not how it is stored inside Relay. Relay will do some processing and actually separate out this JSON payload into two records, one for the users and one for address itself. And it's going to link up this record together. So as you can see here, this record is given an ID. And then the users will be linked to the address field instead of storing the address data inside itself. So the reason for normalization is that it's so much easier to maintain consistency. So let's say you don't have normalizations, you probably need to do more work to keep your data consistent. Let's take an example here. So I have two records on the left, A and B, and they all have the nested field called C. So for us, maybe you have two users who are in the same companies. Let's say one day the company changed the name. How do you update the tools? How do you reflect it in your apps? You don't have normalizations. What you need to do is that you need to find all the users that belong to this company and then go to pie its record and do the updates. On the other hand, if you have normalizations, that means you are, instead of storing your data in a nested manner, you are just linking the records together. So on the right, you have A is linked to a record C and B is also linked to the same record. And that's the difference. Then the updates become pretty simple. You just need to find the record C and then do whatever updates that you need. And this makes the change the update property obvious. The second advantage is that when you normalize the data, you are actually saving some storage. So on the left, you are actually storing two copies of the record C, but on the right, because it's just like you're linking the data together, then you only have one copy of C. So that reduce the storage overhead. All right, so let's look at the pipeline of how the data is written to the store again. Here we have, we also established some data from the server. They can come from the like the results of a query or you are updating some data or just having some optimistic mutation, which is a concept in Relay. But Relay will try to normalize this data into record source, which is just a dictionary and update in the store in this form. Then the change will be published to the store. The store will look at the payload and then combine the data received with like its internal data. Finally, the store will notify the subscriber for changes. But you can notice that so the most important thing about this diagram is that the publish and notify part is separated. When you're publishing the store, you don't immediately notify all the users, all the subscribers that something has changed. For some reasons, I will, for some performance reason that I'm going to talk in the next two slides. Here's a concrete example of like, let's go through the flow, some concrete example. So you have like data from the users here. And this going to be normalized into a big dictionary called a record source. And this going to be published to the store. The store will figure out what has changed. And then after that, they're going to notify your subscribers. In this case, it's your UI components that something has changed. Please go and update all the fields yourself. Here's one of the most interesting thing about the relay architecture is that the publish is really decoupled from notify. So the reason is that if you split, you separate these two processes, then you can actually achieve some performance because the store can actually combine multiple payloads before notifying any subscribers. So let's say you have a post and then there are two comments from your friends coming in. Then instead of like telling your UI so a bit twice, right, you can actually combine these two into one event, which is there are two new commands added. And the UI can just do the re-rendering ones. So that saves some computations. And so far, I have covered how the data is written to the store, but it will not be complete if you cannot read from the relay store. So now let's look at how we can achieve the data from the store instead. So the cool thing is that there's only two APIs when it comes to reading from the store. The first one is called the lookup. And since each component in relay must declare its data requirements, relay and convert this data requirement into something called a selector. So for example, here you have a post and the selector is the thing that I have like circle in red. And it's asking for a post with a certain ID. And what you're reading from the post is just a title and the descriptions. Then you use this API, then you get back from the store or the data in a form of something called a snapshot. And the second API is called a subscribe. And the API allows us to register a callback so that every time there's some changes in the store, it will tell us that something has changed. And basically, we can know whenever the events happen. So that's just about the two APIs for the read part. And one interesting architecture, I mean, one interesting optimization is that the relay try to differentiate what kind of events it should try to limit the number of events that are going to tell the components. So let's say you are having a post that listen to records three and four here. But during the update, from the server sent to the store, the store has recognized that only the records one and two has changed. So it recognized that there's no way the components is going to be interested in this change. So in skip that update, skip that notifications to the UI components. Then potentially, you can save some computations from that. So that's a quick rundown for me for the relay storage, which is JavaScript framework to work with the React and GraphQL server apps. And with that, I'm going to end my talk here. I also want to do a plug here where that our company Facebook is hiring. So if you guys are interested, you can go to the links here or just scan the QR code. Thank you so much for listening. And let's have some Q&A. Thank you so much, Min, for sharing about relay. Folks, if you have questions, you can either unmute yourself or drop them in the chat and we'll have Min adjust them. I'll give you people a few more minutes. In the meantime, just quite a quickly share my screen again. If I can find where my... Sorry, give me one second. I seem to have lost my Chrome. No, found it. Okay. So all right, folks, if you don't have any questions from Min, that's okay. But we'd really appreciate if you could give us some feedback about today's meetup. Hang on, whatever you want to call it. You can either go to the link at the bottom or scan this QR code and give us feedback, either for us as organizers or for Saranya and Min as the speakers. Tell us if there are topics you want to hear about or specific things that you'd like to get us, specific people you want us to get. Please feel free to add it in the feedback form and we'll try and address it as best as we can. If, yeah, I'll just leave it up there for folks to look at it. And now we have the floor open to just chat if anybody wants to do that.


At the recent SCCR meeting that ended this past Friday, we focused on the issues that have been on our agenda for some time. So those are the Broadcasting Treaty that's proposed to give broadcasters tools to fight piracy of their signals and then limitations and exceptions, exceptions to rights of copyright holders like authors and creators for libraries and archives, for educational and research institutions, and for persons with disabilities other than visual impairments. On the Broadcasting Treaty, we got some progress in terms of narrowing the issues with respect to what ability the broadcasters would have to stop piracy on the internet. With respect to limitations and exceptions, the Member States welcomed a new study we have on libraries and archives on basically what the existing situation is in the Member States and asked us to provide similar information that they can use for the discussion next time on educational and research facilities and also for the persons with other disabilities. So that's something we'll try to prepare for December. In addition, there was a proposal to put the resale royalty right on the agenda that's been deferred to the December meeting. There was overall a really good positive tone and we hope that that tone and that positive interaction, really thorough debate and discussion of all the issues, follows the SCCR into the assemblies where the assemblies will review the report from the SCCR and decide whether to give any direction for the work.


Hello and welcome to the Active Inference Lab. It's Acton Flab Livestream number 28.0 on September 6th, 2021. We're gonna be talking about the paper towards a computational phenomenology of mental action, modeling meta-awareness and attentional control with deep parametric active inference. Welcome to the Active Inference Lab. We are a participatory online lab that is communicating, learning and practicing applied active inference. You can find us at the links on this page. This is a recorded and archived livestream, so please provide us with feedback so that we can improve on our work. All backgrounds and perspectives are welcome here and we'll be following good video etiquette for livestreams. Thanks a ton, blue and Steven and Dean. Nice, fun to have a dot zero crew together. Here you'll see a slightly updated version of the upcoming streams calendar, which you can get at from this short link here. September 7th and 14th, we're gonna be discussing this paper. We're gonna be discussing in this one. And then we don't have a paper for 29 and then we have some papers set with authors for all of October. Also, check out the tabs to see other series other than the Tuesday paper centric walkthroughs. And of course, anyone's welcome to co-organize an event or to be the guest for one of these types of streams. All right, so today in 28.0, we're gonna be just learning and discussing this paper that was already mentioned by Sandvint Smith, HESP, Metaut, Friston, Lutz and Ramstead out only a few weeks ago, which is kind of cool to see. And there's gonna be a time to talk about. It's a super interesting paper. And if you wanna participate in 28.1 or two, you should get in touch. Otherwise, if it's after that time, then check out those videos and maybe find another one to participate in. But I'm just looking forward to hearing what you all were excited about by way of introduction. Just wanna hear from everybody and what was exciting to them about this paper or made them wanna join for the .0. If I go first, Daniel, yeah, thanks. I'm really excited to, or interested to see them moving beyond a computational approach to neuro phenomenology, which I've seen before and into this broader idea of what they're calling computational phenomenology, which, well, it's a bolder claim and has more relevance potentially to other applications which I'm interested in and applied active inference context. So, we'll see how that bold claim can be applied. Nice, okay. So, for me, I thought it was like ultra meta. The paper really got into the hierarchical levels of organization, which I'm always excited to see and talk about. For me, it was the fact that I am doing some writing right now and I am interested in the idea that there is a way of putting this into some sort of a geometric relationship as well as the computational relationship. Cool, okay. The paper is, let me just re-prim it, is Towards Computational Phenomenology of Mental Action, Modeling Meta-Awareness and Attentional Control with Deep Parametric Active Inference in Neuroscience of Consciousness published about two weeks ago, 27th of August. Does someone want to read the three aims of the paper? Sure, go ahead. The three aims are to explicitly model meta-awareness to account for the computational consequences of meta-awareness on cognitive control, and lastly, to provide a computational account of mental covert action. Okay, and then maybe the second part. Sure. Formally speaking, the crucial thing to note about these cognitive processes is that they are about other such processes. The deployment and control of attentional states and processes, for instance, are quintessentially a higher level ability. Such states and processes monitor and modulate other, typically lower level perceptual states. Third order, higher level processes in turn oversee these attentional processes. We can be aware of our attention being grabbed and make a deliberate decision to focus our attention elsewhere. It would seem then that effective self-regulation of attention depends on the ability to access, evaluate, and control the quality of these attentional processes themselves in the same way that attentional processes are necessary to consciously access, assess, and control lower level perceptual states. Interesting areas. It's just interesting to see that the kind of framework that helps a robot navigate, now it's being used in a little bit of a different way, like nesting within ourselves and coming closer to our experience and other things which often are said to be unable to be directly observed. So it's quite a cool topic. Dean or Stephen, any thoughts or do either of you want to read the first abstract? I got a quick thought before we get to the abstract. In the introduction of the paper, I just want to read this really quickly. It's in the paper, but computational terms, the central place of confidence and reliability and effective self-regulation speaks to the key role of precision or inverse variants of implicit beliefs. And then they talk about probabilistic and posterior Bayesian beliefs that describe a probability distribution over some latent quality. But this was the thing that I found really interesting. Bayesian beliefs about Bayesian beliefs can, in certain situations, become propositional and the way that they are estimated, optimized, and controlled. Decisions in a nutshell quantify our confidence in our beliefs, say how confident we are about what we know about states of the world, about their relationship to our observations or about how these states change over time. Being able to place numbers around that, but as soon as I read that and saw it in relationship to a proposition, I found that really interesting. And one, it was really curious to see now how is that thread going to play out? Now, it wasn't part of the three things that were in the previous slide, but I think it was a really important and something that was... It has to be a name or a claim of the paper because it's pretty fascinating. Good call. It's almost like a background assumption, whether a post hoc justified by empirical appeal or not, that precision is what matters, which is kind of the other side of the coin from uncertainty, like high precision means low uncertainty and vice versa. And sometimes they're framed as... So I think totally agree. That is a claim of the paper. Okay. Steven, want to go for abstract one? Yeah. Okay. Meta-awareness refers to the capacity to explicitly notice the current content of consciousness and has been identified as a key component for the successful control of cognitive states, such as the deliberative direction of attention. This paper proposes a formal model of meta-awareness and attentional control using hierarchical active inference. To do so, we cast mental action as policy selection over higher level cognitive states and at a further hierarchical level to model meta-awareness states that modulate the expected confidence or precision in the mapping between observations and hidden cognitive states. Nice. Yeah. There's a lot of terms, some of which we're going to go into in the keyword section, but pretty distilled down description of their contribution, and we're going to unpack it more. Okay. Abstract two. We simulate the example of mind wandering and its regulation during a task involving sustained selective attention on a perceptual object. This provides a computational case study for an inferential architecture that is apt to enable the emergence of these central components of human phenomenology, namely the ability to access and control cognitive states. We propose that this approach can be generalized to other cognitive states and hence this paper provides the first steps towards the development of a computational phenomenology of mental action and more broadly of our ability to monitor and control our own cognitive states. Future steps of this work will focus on fitting the model with qualitative behavioral and neural data. Okay. Cool topics. Any thoughts or we can move on? First steps. That's the emphasis here, just first steps. Yep. I'm pretty excited to get to this, the generalized model of mental action because it's like almost like the new tool enables asking about phenomena that we already know and then it reveals a whole new state space of kind of then the model feeding back to the kinds of regimes of attention that we designed for ourselves or niche modifications or information inputs. Okay. So this paper has an interesting play out. It is just an introduction that brings up the non-active inference sections related to the scientific study of mental action and about how it's been computationally modeled outside of active inference. Then there's a methodology paper that first has more of a model building narrative and then the empirical results from a simulation that has a few different layers of detail layered on it. It's not just one single model. There's a few little variants that help get out which parts of the model are contributing which behavior and why. Then they have a more general discussion and give some directions for future research and that's where some of these big claims about computational phenomenology go and then there's a conclusion. So any thoughts on the roadmap? Yeah, I think that this gives a good sense of the way that they're trying to enter into this space looking at the opacity and transparency of phenomenology and trying to sort of bring back that neuro phenomenology into this wider phenomenology by sort of looking at the experience. Now, the question that sort of comes up with this is because obviously a lot of the work here with Ramstad and others has been around embodied cognition and stuff like that. So they're sort of going into this idea of trying to set it up so that they can target phenomenology while still keeping it around mental states and cognition. So there's an interest in, I don't know, ontological dance. They're trying to find a way through here, which I think is kind of interesting. Any other comments on the roadmap? Okay. So the keywords were free energy principle, active inference, neuro phenomenology, metacognition, opacity, transparency, focused attention, mind wandering, and mindfulness. So perhaps blue with FEP. Sure. This slide I pulled out of the live stream 15.0. So the free energy principle is based on three aspects. The observation of self-organization, which brings us to the second aspect, which is that living organisms can be described as stochastic dynamical systems, possessing attractors. And then lastly, the states in which the self-organizing system is at a point in time can be identified by the interactive role they play within the multi-level self-organization scheme. And then this is related to, in the slide from 14.0, multi-scale systems, ensembles, infothermodynamics, and variational Bayesian inference, which I thought was applicable here as we're going through this hierarchical awareness, meta-awareness. Cool. Yeah, Stephen, and then I'll go up there. Yeah. Well, yeah, I think this is good to characterize this. And also, I know that Maxwell mentioned how that multi-level graph, he's kind of gone back on it a bit, but it does show that whole question. It's a really good diagram to show both that there is this multi-level nested sort of multi-scale thing going on. And also it's kind of a contested, it's a contested or kind of evolving part of the whole field, because it's people are sort of putting out things, and then they may be backtracking a little bit. And so I think, yeah, I think it's quite a good thing to bring up. Definitely not a settled area. That's why it's so fun to just have these discussions on the topic, because even the paper is not the end result. It was first steps. And we're going to see in this discussion, the multi-scale system is almost like psychologically nested or mentally nested within one agent, whereas previously we've been talking a lot about multi-scale systems in the context of a bunch of ants making the colony, a bunch of communicating individuals making the community. So that's like multi-scale systems out and getting spatially bigger. And this is kind of getting more ephemeral, but also having this very interesting influence on the lower level models. So for active inference, the keyword, we can look at what the authors wrote, because it's always cool to see just how did they define this, how did they frame what active inference is for this paper. And they wrote that at the root of these advances is a biologically plausible, neurocognitive, and behavioral modeling framework called active inference. Active inference provides us with a Bayesian mechanics. That is, the mechanics of knowledge driven action and active perception, which explains the first principles how autonomous agents can thrive within their ever changing environments. Active inference descends from and is closely related to Bayesian brain theory and predictive coding. And then this green one I thought was very interesting in how they said it was active inference casts perception, learning and action as essentially being in the same game, that of gathering evidence for the model that underwrites the existence of the agent. So just on the diagram that we've seen with the four different kinds of nodes with the blanket states of in and outgoing in the internal and external states, like to say that the three that constitute the organism, let's say, are all in the same game, just bring sort of a unity of action and inference to how we think about the very least other systems that already have this structure, like input-output systems which some people speculate describe all classes of systems or computational systems. So it's just like the way that they made that clear of active inference without tying it to a specific model implementation that was very well set. Stephen? And also this does give a flexibility as knowledge evolves because as Mark Soames has been talking about the way attention maybe moved around more at the base of the brain using more kind of attentional, biological, you know, inactive questions that wouldn't necessarily be a problem for this because this modeling isn't completely tied to some sort of frontal cortex model of thought, it's kind of broader, so I think that's quite interesting to see how they're using the term behavioral modeling, the framework and they've sort of, yeah, the way they positioned it because they haven't gone the whole way and talked about biological and gone down the full multi-scale biology route, they've kept it kind of in the brain, but they've brought in that behavioral element which I think neuro phenomenology maybe doesn't do as much. Good segue. Blue, want to describe this one? Sure, so neuro phenomenology in the words of the authors, neuro phenomenology has been described as the search for generative passages between the neurobiological, phenomenological and mathematical levels of description, going beyond the description of mere isomorphisms between these levels toward mutual epistemological and methodological accountability and cross fertilization. Neuro phenomenology aims to bridge the gap between these kinds of data via the formal metaphysically neutral levels of the description provided by mathematics and computational work. And I pulled this cartoon out of this paper because I thought it was kind of a neat perspective and visual on neuro phenomenology. So it talks about the biological structures as like predetermining the world of the organism and then neuro phenomenology as a praxis between the first person account that the organism has and the neural descriptions of these structures. So that was the point of this. Nice, fine. Very interesting figure. Looks kind of like a sci-fi human novel. But it's kind of cool. To talk about one specific kind of neuro phenomenology like a first person experience that is desired to be modeled potentially even in a computational direction. Here, we're focusing on this metacognition aspect. So just the yellow parts, they wrote, we define meta-awareness in this context as the ability to explicitly notice the current content of a conscious episode. For our purposes as discussed in the text, we define states of meta-awareness as those third order which we'll get to states of the system that are about and enable the opacity of second order attentional states. Metacognitive states thus function analogously to attentional states which enable the opacity of first order perceptual states. So it's going to be a three layer nesting doll. The role that the second model plays over the first is going to be analogous to the role that the third model plays over the second. But that doesn't mean its dynamics are going to play out in the exact same way. And then this last part was very interesting like mental action refers to goal-directed internal behavior without necessarily having a direct consequence on the external environment, e.g. as though muscular action. A paradigmatic example of mental action is covert attention. So what an interesting topic. You know, the whole think of X or don't think of X, I'm not playing any language games on the live stream but many of those exist and they have to do with inducing mental action. So that's just so interesting that that's what this framework is going to be exploring. Okay. Stephen, go for it. Yeah, and without you know putting too much pressure on the paper to go further, but is it that question of skill performance and the phenomenology of being in the flow or being in a state of sense making it be interesting how that neurobiological phenomenology phenomenological passages can extend out into some of that kind of work which is obviously highly complex but you know these might give us clues so that's good. Yep, cool. And then I found this link trailblazing ants show hints of metacognition when seeking food and recent research has shown that bees when faced with a difficult task simply opt out of doing it a behavior that may be interpreted as a form of metacognition at least computationally. Now it seems that ants might be capable of a similar mental feat despite their tiny simple brain. So it's like what computational attributes are we going to assign to but that's just how bark is or that's just how ants are versus this variable is the one that we're experiencing because of this so that's just kind of a topic that's going to come up probably multiple times. Okay. How about transparency and opacity? What does it mean in someone's words or reading here? Can I bring that a little different angle to this? I mean I understand how the contrast of transparency and opacity works but when I was trying to figure this out to help somebody who was walking into a situation oriented to a lot of the data around them that they would otherwise be overwhelmed with one of the things we talked about was the difference between liminality and just getting a generalized sense of the orientation space and then limitality sort of filling in the details and getting an understanding where the edges are so that you don't bump into them and hurt yourself and so I get the transparency and opacity piece of how it's explained in the paper but for a person who's trying to move from the generalized to the more specific I think it's the opacity piece speaks clearly to the difference between that and something that's clear but I also think that the details get filled in when you can have an understanding what the limits are and not just liminally understand that it's now in your field of awareness having this which is your where's your focus, where's your attention Ankstein I put this goldfish meme it's the story about the goldfish and what is water and the elder one is aware of water and then the younger ones are unaware of the water that they swim in cough cough and then it's kind of like the two mental extremes like water is opaque you can think of the water being like cloudy to this fish it has a different vision so then it can see that there's a drop-off in vision it infers that it's in opaque water so water is something that it can ask about the conditions of whereas the small fish in this example it's clear it's like transparent so they're seeing through it it's transparent to them so they're imperceptible so the green ones are accessible to the system you're aware of it it's like water that has an opaque tint and then the transparent means it's essentially and that's a philosophical framework by I think Metzinger which has probably been influential Yeah highly influential I think and increasingly so I think this could be pushed a bit further because I think it's okay to state this as almost a philosophical piece but bringing in stuff like mental space psychology hasn't really been incorporated in this area. But, you know, these subconscious sort of opaque or transparent awarenesses are part of our, could be part of a deeper way of knowing if we assume that thinking is through our senses. If sense, if actually the process of the brain is not all in the box, but it's recapitulating stuff through the sensory world around us, even in the subconscious, that would tie in quite well with this, but also give a bit more of a computational grounding. The other thing too, Daniel, if you'd have written the words opaque and transparent in a white colored font with that white background, they'd still be opaque, but we wouldn't see them on the white background. And so that's it, again, where... Nice, good call. In order to be able to bring the idea forward, it isn't just a comparison of transparency to something that actually has a sense of tangibility. There's this other part of it that we'll pick it up because there is a contrast. There is some differentiation and it doesn't always just have to be something's clear or something has depth. Thank you, Stephen. Yeah, that's a really good point. And actually that can extend as well to the size of the space you're in. So if you start to imagine the relationships or these kind of subconscious senses of how close or far certain ideas are, that changes depending on the size of the actual room you're in. And I imagine the different colors of the room, the lighting in the room as well, might affect, I haven't really thought about this before, it might affect the transparent states as well because there may be some sort of calibration going on. So it might be quite profound to be in a blue room in terms of what your transparent states end up recapitulating. So that's interesting. We'll come back to, I think, niche modification and design and regime of attention. Who made this slide or what did it mean to anyone? So this was mine. The focused action I thought was like an interesting keyword. The authors didn't use it once if you search the paper. And then as a Google search, you search for focused action and you get all kinds of life coaching, which is like, whoa, okay. I don't think that that's maybe the intention here. So this is just the typical active inference loop where you have internal states, perception, external states and action that are all connected and partitioned by a Markov blanket. So I'm extrapolating based on what I think that the authors mean. Here low precision is unfocused and it's low precision also in terms of perception because perception is also when you register, you just saw something, they talked about the odd ball and you're seeing an image, seeing an image, seeing an image and then all of a sudden the image is different and it's like, oh, I wasn't even paying attention to what I was seeing at all. So it's that perception can also have this kind of unfocused quality. So I related this to like a low precision kind of perception or action as unfocused and where it's high precision, where you're focused on what you should be focused on, that's focused. Thanks, just one note on that is under the reward paradigm plus minus valence, avoid approach, sort of forward, backward, linear mindset, we can say, oh, well, not just do we diagnose happiness or sadness or on a linear scale, but it's a goal. And so just what are the aspects of our experience or of just the outcomes of systems that can be said to be related to focus and attention and action. So how about just to mind wandering since it's related to the topic? Sure, this is, so here, these are different papers. And so mind wandering has been explored in several different contexts, but specifically like the figure on the left is by Wanda Hassankamp. And she studies, she's at the Mind Life Institute. And so studies directly, meditation and the effects on the brain.  And then you have a state of focus again. And this kind of contrasting neural model of mind wandering, this is a 2016 paper. And here they discuss this in a very different way. So when I think about mind wandering, it's easy to think about in the context of meditation, but here they describe like, okay, if you're focused on a task, that's on task, and then mind wandering is actually pursuit of internal goals, which I thought was interesting.  And then they call this off focus is epistemic exploration. This is like the exploratory, like where your mind, what I think of as mind wandering, they call this off focus. And so I thought that that was kind of a different paradigm and not something that I'm used to hearing, like where you're just, where you catch yourself like, why was I thinking about red balloons and frogs with three legs? Like, were you just find yourself in this intellectual state? Like, what am I thinking about? Or why was I even thinking that? Whereas mind wandering is like, you really are thinking about like something else that's like, you should be thinking about, but not, it's not exploratory, which I thought was kind of interesting. Cool. The things I'd say about that on the bottom right, first it doesn't look like there's a transition from the bottom left to the bottom right. So it could just be that the dynamics, the attractor dynamics of this dynamical system are such that when you just down project these massive data sets of neuroimaging, you get certain transition dynamics, which is totally the case. Like you're sleepy before you fall asleep and then, you know, different people accelerate or have different dynamics, but there is kind of a trajectory. So that was one point was, these could be very nuanced states and then the space and the transitions that exist or don't can be important. And the second thing is that the Y axis has to do with some neuro activity, some neuro marker, where it's low in the bottom two and high in the middle one, but then the X axis is behavioral results. So the idea would be that there might be some correlation between like, wow, they did 30 seconds of really good task. And then there was 15 seconds where they totally didn't do the task or was variable. And then if you found a neural change that was like immediately preceding that or after it or during it, that's the kind of cross data set connections that this research is getting towards. But instead of just putting this into the broad framework of dynamical systems and statistics, now we have a process theory like active inference to explore some of the dynamics that give rise to those patterns. So blue and then Dean. So interestingly, there is a correspondence. So there, it does map what was found and I had to like read into the paper to kind of find this out, but the mind wandering in the left image does map actually to the mind wandering in the image on the right or the brain regions are super similar. So I mean, I read to just make sure that there was some confusion there and there is. So it's like interesting to me to think about this off task, what is like off task versus mind wandering and what like for me, if you're meditating and you're not like focused on the thing like you're off task, but it's, I don't know, it's super interesting. I just wanted to clarify that one point though that there is a cohesion there. Thanks, blue. Dean. Yeah, I used to have to work with people who were at a real, I gotta be playing because I'm being recorded. They had a real joy out of looking at time on task this was something that was a something that they found really, really important. And so if you were task designing, you were supposed to be able to create something in your design scheme that would keep people focused all the time. And in the meantime, there's a whole bunch of interesting papers that have come out in terms of creativity and tangential thinking and mind wandering as an actual gift for taking what's in the task and making it your own. Like if you're mind wandering, you're not, it's not a disconnected thought that you're having and unless you're really being distracted by the video game or the music or whatever, it's usually something tangential to the task at hand. And it's essentially an embodying exercise. So to, I think this is good stuff just because I think lots of times mind wandering, if you're focused on how many minutes was a person focused or concentrated is seen as a negative when from creative stance, it's a really important thing to do. Thank you, Dean. And then Stephen. Yeah, I think it's useful to see a transition the son is at some sort of transition state between the regime of attention where you're on task and a regime of attention where you're mind wandering. So I think that opens up questions of how things, you know, liminal spaces between states and the need to, like if you're always coming back on task, yeah, it would, and you're not getting beyond that state of losing focus. And that could be a problem. I mean, it can be a problem if the mind wandering doesn't get back on task as well, I suppose. But so I think that would make a lot of sense, I think. Nice. How about mindfulness? So just the yellow part and then blue or anyone can give a thought on what they added or mindfulness for the purpose of this work, they're gonna focus on regulatory cognitive control strategies in which an agent seeks to control their mental states by becoming aware of the state as a cognitive process as opposed to regulation strategies where one remains engrossed in the contents of the state. This style of regulation is central in mindfulness related intervention where patients learn to change their relation to thoughts and emotions rather than change the thoughts and emotions themselves. So this is pretty interesting. So becoming aware of the state as a cognitive process is like, this is a thought, I'm having a thought. There's many, many praxis, many knowledge traditions built around this, which you can mention or have people with experience talk about. And the alternative is like, when you feel X, feel the X and be the X, that's sort of the opposite Q. So we're thinking like mental action, cues for action, like cues for a sport, Dean's favorite topic. And then there's cues for mental action that are verbal or have other modes of being delivered and what are the cues for mental action that leads to different regimes of attention, like Stephen said, and then how are the measurements that we're going to make from different modalities going to inform that study and the kind of modeling that integrates across them, which we'll get to as well. Stephen? Yeah, this is a useful piece here. It's good to distinguish between, I mean, often with children, for instance, there's now more emphasis on mindfulness. The bitters that big push to just get them busy, make them do sports, make them do this, make them do the other. So they're so busy with something they can't think about anything else, but actually saying to them, okay, you're gonna be in a space where you could think of other things and you're gonna work on how to not focus on other things. Has some benefits. I think there's some slight downsides to that if someone's got trauma because then it opens up the space for those things to be coming into play. So I suppose, I think this is really helpful to see where they're going. And it'll be interesting to know how this plays out because there's always a danger if someone tries to scale this type of work because it's also easier to use the insights from this type of work to try and capture someone's attention at scale or capture many people's attention by using some of the levers here as much as it is for the person on the inside to be able to resist all the distractions and the flashes and the light that they keep getting exposed to in their daily life. Thanks, Steven, Blue. Yeah, kind of, I wanna just follow what Steven said. So I don't know that the children or even like us adults being constantly exposed to flashing blue light, like the smartphone, like instant dopamine addiction, you know, fulfillment thing is necessarily the opposite of mindfulness. I think that that feeling is maybe the elimination of boredom, which you can have mindfulness with boredom or mindfulness while doing nothing and mindfulness while not doing nothing. So you can have actually not sitting in mindfulness meditation but retain through, this is called like, you know, meditation practice, the meditation off the map, right? So like there's the conscious placement of the mind during the meditation session but then when it's over, you carry that into your daily life by constantly like asking yourself like, where is your mind? Which is like this, that's the image I put in about the old pixie song, where is my mind? So there is the ability to carry mindfulness even if you're very busy, you can still practice mindfulness in your daily life without taking time to sit on the cushion. So I think we are starving our children of boredom, which maybe is, I'm more focused on or more worried about a lack of creativity because I think that that boredom process where your mind is really wandering to red balloons and frogs with three legs, like that is where the creative nature tends to bubble up. Awesome, and I won't mention the person's name but I hope that they've emailed us, they have emailed us so I hope they talk more about it but they've related these aspects of active inference to the yoga of action karma yoga and basically like the way that action exists in the world. So I hope, stop what my knowledge area is. So I look forward to learning about that though. So before we jump into the paper, this has been a nice long background because there's a lot to say and it's pretty interesting. Look at this fun April 1st, April Fool's Day with Steven and Blue and I. But they write in this paper that the key technical innovation presented in the paper is an extension of the active inference framework derived from the work of HESP at all 2021 which was the paper that we discussed in live stream number 19. So if you want kind of the kernel of what this discussion is about then check out number 19.0 and 0.1.2 and we were talking then about affect and about the way that that made deep agents so listen there to learn more and now we're gonna be doing a few of the similar things seeing some similar figures so it's a good background, listen. Okay, figure one.  It says in the caption, a probabilistic graphical model showing a basic generative model for moment to moment perception. Okay, so the observation O is gonna be used across different layers but here is the model of perception. So we can debate whether it's realism or not later but this is kind of like the retina or the sensor of the camera O. It's like, did a photon hit it or not? This is an observable that you measure with a sensor. S at each level is going to be a hidden state so-called because it's not directly observed but it's inferred from observations through A which is a mapping. So like this could be day and night and this could be photon hitting versus no photon hitting and then you can imagine the mapping there but we'll see how they nest and get more complex than that. And then D is the initiator, it's a prior over hidden states which turns out to be important because as you compute the likelihood of different hidden states being the case moment to moment or through time you need to start with an idea of essentially how likely certain states are and how closely they map to observations. That's the kernel of the Bayesian modeling that we're gonna elaborate a lot like multiple successive times but this is the underlying system that can be thought of like photons hitting the receptor and a mapping to underlying states as influenced at least initially by a prior. Okay, any comments on one or we can go to the next generalization in two. Okay, so two is a Bayes graph showing a basic generative model of perception with precision. So it has the same terms and D S A O as above D S A O but now there's a new node and each shape just at a first pass represents some value that can be taken by a variable and then an edge that connects to states is like a relationship between them and there's different kinds of nodes and there's different kinds of edges slightly and how they influence each other but they just mean that they influence each other and that's important because the edges actually in the grand scheme are very sparse. It's not an all by all model. So this model is extremely more tractable to compute than like an all by all matrix of just estimating the coefficients of how related terms are. So it's a very constrained model space but it still describes a lot of system and the second figure adds in this gamma sub A which is the precision which is one over the uncertainty. So just as we had talked about those being two sides of the coin earlier this is like uncertainty slash precision depending on which way you wanna think about it. High uncertainty, you really answer that's low precision and vice versa but it still maps onto the sensory outcome in both these cases after the sensory outcome occurs then there's an update. The prior becomes the posterior after getting a precision weighted updating and that's just how Bayesian updating works. So this is a Bayesian scheme for updating that initially doesn't include a precision on the A and now it does include a precision on the A. Any thoughts on two before three? Yeah, I think it's interesting. It's good to know that the expected precision is tied to the likelihood mapping. It doesn't try and tie itself directly to the state. It's in the way that the state is being, so that helps to really notice that and make that clear because that gives the logic a little bit more of clarity. I think that's often a bit that's not teased out as often as it has been here, that's quite useful. Awesome, cool. And what else is interesting? So good observation that the uncertainty is connected only to the mapping. So it's not uncertainty about the state it's about the mapping in this formulation. Now we're gonna see a similar move when two things happen in figure three to bring that previous model into this kind of twice generalized space of generative models of action and perception. The first thing is that now there's observations through time versus at a moment with just one observation. So subscript one, two, three. Through time, three time steps. Then here's that DSAO stack and then B is the transition matrix between states through time. So we talked about that on other streams before. And then again, a similar move just like you pointed out, Steven, how the uncertainty or like the intervention in this case, the policy PI, it's actually modulating the transition mappings rather than the states themselves. So I'm sure that has very interesting computational properties that I don't know the details of but I think that's some components that make it amenable perhaps to message passing or to the variational inference methods but that's definitely a interesting observation that you made and it's true. It happens again here in a totally different way. And then PI, the policy selection is influenced by preferences which play into the calculation as expected free energy as well as this baseline prior E. So we've seen this one before and this is how policies are selected over for the next time step based upon the expectations of hidden states and observations through time in relationship to priors E, how their app to perform before starting this sequence of events and then the way that they calculate their preferences over observation states which also relates to how you said the body centric inference. This might be a question, Daniel, for them but it says preferences over outcomes and it goes into the expected free energy. Is that almost like different ways you could wait the way the expected free energy terms are presented over maybe Hamilton's least action versus resolving, you know, if you're doing something like that, I'm not sure we can answer that, but does that make sense? It's a preference for sensory states and then we saw in the model stream one with Ryan Smith like if you wanted to have a very weak preference in the matrix, it would be like one versus 1.1. I'm just making those numbers up but the point is like they're relatively close. It's like a 60 forward the election so that the preference is very weak and then you could also set it up to 100 versus one. And then if you think about that like when you're just totally thirsty and you're willing to engage in all kinds of actions that's how you could computationally put in direction as well as magnitude of preferences over outcome. Some people described, you know maybe some individuals have a broad sensory tolerance others have a narrow sensory tolerance or preference. So that's so you got you. So it's almost like you can, you can narrow you can either open up or narrow down the amounts of options that are gonna be available by saying the gap here. And then in the absence of preference if you don't have a preference for pheromone it's just gonna be a diffusion walk. So that's how preference plays into the decision making but also other pieces do too. Okay, so then here oh here's where we introduce this second nested layer with the deep generative model of mental action. So here the same D S A O is recapitulated from the orange but then the O is split into two nodes. One is an estimate of the state but also it's passing or connecting to the precision the uncertainty. So the features that were being discussed like up until figure three as being just part of how the inference was performed are now still doing the same exact role. They're just being emitted by the state through the A S sub one of two like the second level in parentheses through the A matrix at the second level. And then that's resulting in these two outputs. So this could be like a nested layer of thinking or a nested layer of concurrent programming or a nested layer of formality. Dean. And I'm gonna get the author to make sure that I'm getting this right. Before something I remember from what Kepler talked with his effective piece and then there's a figure five which we'll get to but to me the figures one, two and three aspect of this are the unplannable parts of it. The figure four does ask the question why am I or yes, why am I trying to pay attention to? It's kind of the transition space and then the figure five is where we could actually do some planning because we're saying to ourselves now pay attention because we're putting idea that second order we're paying ideas to ideas piece. So I think up until this point up until figure four it was unplannable what we're modeling. At figure four we start the transition and then in figure five we can actually incorporate a plan if we so choose if that's part of our policy. Nice point. These are really helpful labels like pie at the first level what am I trying to do? So in the case of the light hitting the receptor and then is it day or night? When we introduce policy that would be like should I swivel the cart, move my sunflower head left or right, move my camera left or right under the preference for light. Now if you didn't have preference it wouldn't matter, right? If you don't know where you're going it doesn't matter where you go but if you have a preference factor that gets increasingly stringent you're gonna pursue those policies that will lead to getting the observations that are in line with your preference. Now here at a second level so this is again what am I perceiving and what am I trying to do? That's the motor cart with the visual receptor and then here the hidden state and again it's just the same exact placement analogously the first layer is what am I paying attention to and the policy is a policy overattentions. So that's what makes this model nesting outside of the smaller perceptual level model. So Blue did you wanna say something or no? Okay, then Stephen go for it. So it's treating the precision and it's somehow merging that with the states and putting that through another matrix and probably doing that. I know Brian Smith talked about a cycle of six in terms of when they model they go through six, you know it will iterate through six and then the next level will just sample the sixth data point so to speak in the faster data going below. But I'm not sure how does that work with the two being combined and is that the two are combined basically to give you the higher 02, is that right? So I don't know about the six specifically but here you can see like at the first time point of the slower model this is like the hour hand there's like the estimation or inference over states one, two and three and everything about them like what's the hidden stay and the mapping and the observation which you can then conditionalize the inference on a subset of those variables but that's what the whole model is and then it's like you're estimating at time one about time one, two and three and then at time two you're also estimating over that trajectory but the slower hand is like the hour hand. Okay, continue. So because I think this is where five is where you're getting that Dean it's totally the contribution of the paper. So they summarized it saying that they make three and this is go to the 19 hospital for a lot of this structure. They summarize that they make three novel contributions to parametrically deep active inference models of cognitive control. The first contribution is to stipulatively define the attentional and meta awareness states as the mechanism of opacity control at different hierarchical levels. The second is to provide a formal definition of attentional and meta awareness control via an account of higher level policy selection. The third is to formally demonstrate the relationship between meta awareness states and the capacity for deliberate attentional control. We're going to look at the model in figure five and that's still going to be like sort of the abstract skeleton of the model and then there's going to be a simulation results. So that was kind of all the background actually to their primary contribution. Now in figure five we see this explicitly three layer model and this is the primary contribution is this model topology and architecture and then the interpretation of the higher order states in terms of the opacity transparency and then eventually a more generalized perspective on mental action and bring this all together with a model that does basically the same trick around the second layer as happened around the first layer. So these layer one and layer two are the exact same from figure four. And now there's this third green layer where the states are asking the unobservable question how aware of my, how aware am I of where my attention is? And then the policy question is, am I trying to maintain awareness of my attentional state or something like that? We can get at what exact wording these parameters map onto but totally interesting tape and structure of the model and question. So any thoughts or what was exciting to people about figure five, Stephen and then anyone else? Yeah, it's interesting, it's exciting to see it's got some similarities to the valence the deeply felt effect valence has been a higher level sort of calibration I suppose in a way they might try and find a way to put those two together you know, when you say I'm aware of where my attention is well, what kind of awareness is that awareness? Is it a feeling it feels good? Or is it something else? So yeah, nice. Dean or blue, otherwise we can I just want to say a couple of quick things. So the way that they laid the paper out this made a really good case for why they were focusing on the transparency and the opacity, opacity piece. And they don't make any claims around whether or not a person who's looking at a white page with white text written on it can actually see that white text or whether or not the size of the font is so large that you're only seeing one pixel in the letter A on that page so you can't even see the A but I think both of those things matter when we're talking about attention as well how can you pay attention to something where you can't see the contrast or how can you pay attention to something where the proportions are so out of whack that they just don't make any sense to you. Now I know they're not talking about that here but it would seem to me that that would also be a part of where this computational piece would be really, really helpful because to a learner, sometimes it's easy to see the tunnel within the mountain. Sometimes it's really, really hard to be able to pick something up off the page when it's either way out of proportion or there isn't any contrast. So I just wanted to kind of, I want to give the author's credit and I think I hope I think I know where they're going next. Thanks, yeah. Cool. Let's go into the little one, call this act of the formalities that is kind of interesting and then we can also ask the authors to explain a little bit more to us but just to get at how does this S state sub T so through time, across time points at the second level. So that's gonna be what we're focused on is how this is kind of at the intersection of perhaps you could even say the bottom up and the top down signaling or at the very least it's at sort of a, mid level street in the scale of streets of variables from local neighborhoods like down here in the bottom cluster to sort of regional hubs to this broader connection that is happening at an even slower or deeper time scale away. We're kind of looking at this middle piece as perhaps an example of again, how factors from bottom up and top down interact and then it's kind of like Legos. Maybe it can be generalized from there and you can say, okay, let's nest this within that or see what happens if you connect over here. But they write, mathematically, the attentional and meta awareness state inference is calculated based upon three sources of evidence. Red, prior beliefs. So this is the B and the S at layer two. So those are like what is previously influencing that layer specifically. So that's what happened before at that layer. Direct perceptual evidence, e.g. the metacognitive observation of one's attentional state, blue and then orange. Ascending evidence based on the precision beliefs of the level below. So maybe that's where if you just opened your eyes in the morning and it was too bright and you don't have the resolution, now you can't make the good mapping between fine grain details because your resolution from a sensory perspective like the precision is adapted for a different regime of environmental regularities. So there's perhaps many ways to model this. So then they say something that was kind of interesting for the ascending messages from the continuous expected precision to the discrete states. We use Bayesian model reduction for the derivation C frist in 2018 to evaluate the marginal likelihood under the priors associated with each higher level state. This gives in the case of the attentional evidence for example, and then the equation that has these components that were here. So it sounds probably extremely technical, but it's a pretty interesting topic that we'll look at just in another slide because it is really important to understand how this bottom up continuous info becomes translated to discreetly different states. And then this is just to note that this is like the general structure of the model which you can imagine is also computer variables, but then they preset two mental states associated with just specific parameters that they chose. So especially the simulation is just like a parameter combination. It's not all the possible dimensions one can explore. So that was just to note. So here's, oh yeah, Steven, go for it before we go to model reduction. I think this is helpful to think about that how that top level has that impact.  And there's the other times when you wake up and you've gone away and there's that jolt because the prior expectations were still locked into like you're dreaming about waking up at home or you're sort of, but you're not at home, right? I mean, there's that. So it's almost like you're fulfilling your expectations. These higher level could just start to percolate out as you enter into certain states or into certain rooms. So I think that's quite a nice way of thinking top up, top down, bottom up, and that being about perception as well. Cool, nice point. Deep priors, narrative priors, how did I get here with sensory priors at the moment to moment? So here's the paper with Friston, Parr and Zeidman from 2018 slash 19, Bayesian model reduction. So the yellow parts are highlighted, but just one green part I then kind of take away here is we consider structure learning and hierarchical or empirical bays that can be regarded as a metaphor for neurobiological processes like abductive reasoning. So I know that that's what we're kind of excited about and the paper that we brought up of Majid Beni, but that's super interesting, like just to kind of skip to the last sentence, how are they gonna be using model comparison of Bayesian models to explore abductive reasoning? And one takeaway, but really would be great to have people who know more about this topic, have a little bit more insight would be, like we can compare Bayesian models that only vary in their priors. It's really easy to compare the similar structures of models that just vary in like, whether they think it's gonna be a Gaussian centered at five or centered at seven. There's a lot of tools that help you very rapidly compare that, but if you have two totally disparate model, two programmer languages, they're predicting different things, it's really hard to compare them. So the frequentist comparisons can be very intractable as well as sampling and simulation based ones that are just like brute force or they can have stringent requirements like the hierarchical likelihood ratio test is only applicable to certain subsets of frequentist modeling. So structure learning is hard. What is the structure of causation and what's the structure of the data, the shape of the data, Dean, like you brought up? So how can we frame this question and challenge about learning about structure of data in terms of model comparison or updating of priors amongst models that have similar structures but just different quantitative variables? And so Bayesian model reduction is a way that you can do this kind of structure learning and one loose analogy is the lasso regression which tries to restrict to a very small set of few strong factors in a data set that might have like many weakly interacting factors. It kind of truncates the distribution and just says like, give me the most relevant ones and if it's just massively interacting, then so be it. And that kind of a regression is gonna have a similar use which is to converge upon a smaller number of things that are really informative while keeping the model also similar which should be reminiscent of like the Bayesian information criteria, AIC as well. And then here's in that paper and it relates to what we read earlier. How do you go from like quantitative continuous estimates in this case coming from perceptual updating of like that retina sensor? How do we plug in from the continuous and map to categorical discrete selection of models? So mapping from continuous to continuous, you can just do like a dilation or some other function mapping, but it gets a little bit different when you wanna map between these worlds of continuous and discrete. And it turns out that the way it works is that inference is performed within and among a family of models, Bayesian models that are using parameters like quantitative difference and parameters to describe structural connections between variables. So here's like, let's just say that black is zero and white is one. Then here's like all the combinations of linear models that were used to generate the different models. So this is the exhaustive, frequentist approach. And then here what's happening is the Bayesian model is estimating the relevance of each of up to 20 parameters. And then estimating like a credible interval which is 90% in this case, 90% of the time it's within this interval, we think. That's where it's likely to be under some value of stringency, that's the red blur. And then you prune the ones that are like not significantly different from zero. So it doesn't mean that they're not zero or they're not playing a role or the proteins don't touch but it means that you can actually structurally simplify the relationship between variables. So that's moving from continuous evidence about models of a discrete family to a reduced model that could potentially be extremely parsimonious. So that's just the Bayesian model reduction. But that's like, I guess a sub component of this paper. So wanting to know more about how it comes into play or if there's an analogous process on the generative way down. Okay, any thoughts on that? Or just, that was one little section. Well, I was just thinking, I mean, I'm not sure if I've got this potentially right, but I can see this brings in the idea of how action can be used to think. Like in creative, abductive work, you can start to actually create entropy or create confusion to create some possible outcomes and that the art of the creative process isn't necessarily the creation of random novel ideas. It's been able to prune back. I think comes a bit back to the idea of that task related or focus, mind wandering. The ability to then go backwards and forwards. And that might tie in with this ability here to do this. I'm not sure, but it sounds like this would tie into that somehow. Cool, we'll ask the authors. Okay, nice. Onto the simulations, also people can just leave when they need to. This section is gonna provide the simulation results that show how the model described in the previous section and gender's opacity transparency phenomenology. So outputs of the model that recapitulate some of the dynamics that have been described in other experiments. And then they're gonna use that agent with a three layer generative model. Okay, so first was just the, well, any, okay, any thoughts on like what the simulation is just to contextualize it before we talk more about it. Okay, the code is available. It's a co-lab book. It's pretty cool. It makes a lot of the graphs. So nice work for the authors. Maybe we can walk through it or ask about certain parts, but cool that it's an interactive notebook. Okay, anyone wanna describe seven? Sure, I will. So here it says, just the yellow part says, in the first half of the trial, the agent is in the focus state, which compares a higher precision, i.e. the agent is generally more confident about how their observations map onto states. In the second half of the trial, the precision drops as the agent moves into the distracted state. As a result, their beliefs about latent states are updated more slowly. So this is kind of like, I wasn't really paying attention. Did I just see a car flash in front of me? I don't really know because I wasn't really paying attention. Whereas if you're focused on the screen and watching the car, you see every flash and you know exactly when it flashed. Nice way to put it blue. So the blue is what happened.  And then it is just, this is an agent that's artificially held with a total focus state for the lighter half. And then it just switches instantly and we're exploring how this S at the first level, so to go back to figure five, that's the perception is S at the first level. And then that is an estimate that's changing through time. And so when it's focused, it's like higher highs and sharper and lower lows. And then distracted states just more like, wait, what? Stuff's more just spread out and it maybe has a different recovery or similar speed but lower to rise. So that's how they say that, that's how they make their claims about the way that the attentional state influences A1 by making the likelihood mapping more or less informative. Because if it's uninformative, the likelihood mapping, then why does the sensory input matter go with your gut?  And that is reflecting in figure eight, this phenomenological cycle. So these can be discrete just via that mechanism of the continuous to discrete estimation. And they write that this is the diagram of the phenomenological cycle that occurs during sustained attention tasks. The process cycles through being focused, becoming distracted, becoming aware of this distraction and then refocusing. So it's cool because it looks like internal external states in a way and action intense states. Like it's a OODA loop or there's so many other fourfold models, but what are we actually looking at here? We're looking at the dynamics of that attractor state as it wanders. So I feel like since both of you have thought about attention or awareness, maybe what did this look like or what does this mean to you? Do you think that we attend through steps all the time? I know that for the simulation, they want to be able to see that in order to be able to do the calculations, but do you think people do that? So I think that the shift from focus to distracted is maybe not discrete. Like that might be like a more of a continuous transition, but definitely like as soon as I'm aware that I'm distracted, like the attention gets redirected. Like that is the awareness of distraction is a discrete like bam, oh-oh. And then the redirection of attention is also like I can replace it and then I'm focused again, but then the transition. So it's just this top left corner where it's a little fuzzy for me. I really agree with that, Blue, like awareness of distraction to redirection of attention. That's like, you know, the eye of Mordor. It just goes somewhere else, okay? But then the distracted to the awareness of distraction is actually that same, but it's the cognitive, metacognitive eye of Mordor turning its eye on a lower level estimate. So I agree that actually this from noon to six, it looks, it's pretty interesting in how it maps, but then do we think about focus and distraction as part of a continuum of a single variable? Or is this like, yeah, can you wobble? Or is there like more dimensions to just being super strongly obsessively doing something? How far do you pull back? What if you have to, you know, put down the first pen to pick up a different pen? You're pulling back from the goal, but you're moving towards it. So that's the kind of deep policy questions that are so cool that we're raising blue. Well, so it's cool because here it's this gamma function, right? Like, so the gamma is the precision. And so just by changing the gamma, and like you can change the gamma incrementally, however you want to change the gamma, like 0.01, 0.1, 0.0001. And then by changing that gamma, you can really get that shift, like computationally from focus to distracted by just by changing that precision metric. Yep.  So here I copy to the left side of I think five, and then just laid it next to here. So these are the questions that again, each layer is asking. The blue layer is like the perception layer and related to the policy that's going to get those perceptions in line with preferences. So moving the cart back and forth to be in the right amount of light. Then hidden mental states are about paying attention. And then what influences the precision and emits a precision variable and an observable at a higher level, just like A sub one at the second level. Here's like A three. And here's now the slow one, but it's happening actually at every time point. So again, you could probably elaborate this in various ways and ask like, how many time steps of action are calculated per attentional state? How many attentional states are calculated per metacognitive state? Are they all in the flow? It's so interesting. So here then they also put down the specific matrices. I assume the ones that we'll see in this collab notebook. These are just like the parameters that are gonna illustrate some of the dynamics that are gonna be interesting for the fields. But again, these are parameters that could be learned or updated or could reflect not just a two by two option. All right. So maybe even copying this guy again. Here figure 10. Yes, okay. So here are the three layers of the model. And so the bottom layer is playing the odd ball paradigm. So it's like listening to like regular tones and then once in every X percent, there's a differential tone. But also that could be like, which one of these security events is anomalous or which one of these trades would be effective amidst the prior that 90% or probably not. So it starts off focused and all systems are normal on the sensory side and it gets distracted. It returns to being focused. This is the true state at each level is the dot. So the bottom layer is like the percept of the sound. This is the attention. This is the meta awareness. And then this you see at the change point from being distracted to focus, there's a switch point in the third level. So then everything's normal, the sensory level and then it's distracted. And then the odd ball happens at 21 or something. And then that like flips it. It says flips it back into attention. And then that continues and it stays in that state until an event happens. And so this is just simulating out the dynamics. But the idea with this kind of a graph is that we can scan along and look at how changes in one level either are influencing each other statistically causally within our model, not necessarily about the real world but just literally causally because we specified it in our model and then do parameter fitting and be like, whoa, we can explain 95% of the variance in this behavioral dataset even though we didn't observe the red or the orange we observed this or their task variability. But then we have enough data points from enough individuals and from time series of this individual and then start to add in some other measurements. And there's a lot of data to do inference on these higher order states about. Any comments on 10? Okay. I'm just thinking is so sorry. I'm just thinking about how this is going to be used by companies to keep you working. I just can't help but think about thinking about that. Like, are you paying attention or are you not paying attention? Can we give you an oddball to make you pay attention?  So yeah, like that, I think about that. And it's kind of scary and it's kind of, I don't know, it's real. I think blue have people actually tried to do that. I think they would be more misinformed than they would be informed.  And they're no closer today to understanding it than they were a decade ago and they spent a lot of time on it because I don't know that this literally maps into an appreciation or understanding of what on task versus off task is. There's tangents to tasking. And I don't think that this really gives us a sense of what that is. I think the blue layer does speak to the unplanable. I think that the middle layer does speak to transition. And I think the top green red does speak to planable but if somebody in an organization thinks that they're gonna have a better sense of how they're gonna determine whether a person was on task or not, I say good luck with that. So I actually have a colleague that's developing a way to determine if a person's in the flow state or not, which is very different, very interesting. Like with physiological, so attentional is different. Like are you paying attention versus are you in flow? And it's really interesting and they've got some decent results so far. Yeah, well, they can count the numbers like saccades or saccades and I looked at the whole visual memory thing and all of that literature. And it's still not, they're still not getting any closer to understanding when a person is on or off task because they wanna break it down to that kind of a binary. I say, let them continue to do that because I'm not sure if it's nefarious but I think it has the potential to become that. So I'd like them to go and spend all their time on it because they're not gonna figure it out. Keep them distracted. Odine, laying down breadcrumbs. I love it. Carry on. Figure nine is gonna be that same cycle of four that we were talking about on eight. And now in addition to just the sort of qualitative label, we're gonna map that onto the structure of the model that we were discussing. So here like the redirection of attention is being framed as a policy to pi at the second level. So where's the action? Pi at the second level is this orange one here on a figure five. So that is influencing what one is paying attention to through time. And then that is being mapped to here. And similarly you can read through and just work through the combinatorics here of what these map to from a dynamical systems perspective. Like while it's in a parameter neighborhood or regime or attractor state or manifold that's in one area in a distracted state described by a wide range of continuous parameters that map onto the categorical distinction of the true state being distracted but the perception being that one is focused. Just work through what these distinctions are is pretty interesting. I, yeah, anything to add on that? It's kind of cool. Okay. 11 is gonna be another kind of just like in seven, they have the attention at the second layer at one parameter level and then they just like turn down the dimmer. In figure 11, they're gonna have a high meta awareness and then turn down the dimmer to the low meta awareness at the S three. So recapitulating the way that they added this third layer to Hespital 2021, they're recapitulating figure seven in how they vary the parameters changing through time. But now you can see the dynamics are totally different. Like the spiking between focus and distraction is actually happening faster during the period of fixed high meta awareness. Whereas during the period of low meta awareness actually it's like there's longer intervals. It's like, well, what just happened? I was having low meta awareness the time just flew by or maybe there's another interpretation but it's just a nice plot that gets at how just a parameter combination can give us insight into the structure of the model. So we kind of have the graphical doorway, the programming doorway then this is like the outcome oriented data science way because this is just input in a model. It's just in a machine learning notebook. It doesn't really even explicitly invoke the graphical structure that we've just been talking about the whole time but it is that embodied in a simulation. All right, Dean? No, I gotta talk to the author tomorrow because it brings up the thing about, is it tomorrow? I'm pretty sure. Yes. Yeah, I'm gonna want to bring up what I used to talk about as the crosswalk analogy. I'm just gonna leave it at that. I can see you being a great crosswalk guard. You wait. So figure 12, this is kind of the last figure. I thought this was an awesome figure and one I know that we'll return to many times. A based graph of a deep generative model of mental action generalized over all precision parameters. So now that a intentional state, the likelihood mapping is going from a potentially binary state like we saw here focused or not. I don't mean, yeah. The likelihood mapping kind of like the dark side of the moon album cover can emit like five simultaneous outputs. It can output a tuple or a vector from a computational perspective and it can output what we talked about here but it can also emit an uncertainty and potentially even other things connecting to multiple of these lower level parameters. So now there can be an uncertainty over the priors whereas in the previous simulations D just stood alone and there wasn't uncertainty around it. So just sort of taking the next step and just being like, okay, if we went from estimating the valence with the actual like plus or minus that our thing is going better or worse than expected and we just said, okay, what's the sister of valence reward? The sister is the uncertainty and the precision and their relationship. So now this paper, that's why it builds on has 2021 because it fills in the other complement there which is the precision modulation by higher level states rather than the valence modulation by higher level states, how well are things going? And then that insight to generalize into the variation from a top down level has strong precedent in Bayesian modeling where it's related to like the parametric empirical bays and hierarchical bays. So big. A lot of philosophical questions about what a parameter means challenges in implementing it but this is relatively generalizing step in the publications. Oh yeah, exactly that. It's the same higher level affective states applied to likelihood precision rather than model precision. And then note that this evidence is only available when higher level likelihood precisions is non-zero i.e. when the state is opaque to some degree as a result, the transparency opacity distinction can be directly related to the evidence calculation. So what does that mean? Or just interesting, like we don't notice something and then we do. So it's kind of like it's transparent and then it becomes opaque and then we observe it in this model. It puts us over threshold of observation that takes us off task as defined by policy. Okay, onto the implications and bigger questions. So blue, go for it. Well, so just to your last point, like I wonder if, have you ever felt so focused you're distracted? Like that's a common thing for me and maybe it's focused on the wrong task but it's also like you're focused to the exclusion of everything else. So I just wonder how that goes into this transparency opacity like gradient maybe. So anyway, and then yeah, onto implications and bigger questions.  Did you have something, some response? Dean? Go for it though. So yeah, so implications and bigger questions. So here, like when, so I obviously got one during this discussion about being so focused that you're not paying attention. But also if we're talking about adding hierarchical levels so I wonder about here beyond meta-awareness, I wonder about collective consciousness. Like so is there, when you realize that you're part of a collective and then when the collective develops some kind of meta-consciousness, like so it makes me think about that and about maybe how to model something like that. Maybe in ants for example, because there's the individual level and then there's definitely like the society structural level, the consciousness of the colony maybe. And also, simulation theory, like so at what level like becoming aware that we're in a simulation, like where does that fit into the hierarchical nesting of this deep meta-awareness? Funny stuff, wouldn't have thought that that's where we would get, but that's kind of what it has come to. Any thoughts on that, Dean, before we go to the next slide? No, I think it ties in nicely with the what do we meta-cognize over. I'm gonna bring up the crosswalk tomorrow. Yep, so this future of phenomenology slash neuro phenomenology, just whatever we want to call it, here's just a few angles on what is slash has and will happened. There's multimodal brain measurements, OSPM, where are they staying? But just it lays out in 2007 and earlier, but in that textbook and in the online documentation, kind of generalized frameworks for harmonizing across different modalities of neuroimaging, behavioral imaging, hidden state modeling. So a lot of the seeds are in SPM. What we can talk about integrating now, other than in a laboratory setting, like EEG and fMRI, at the same time together, but increasingly, even at home, physiological sensors, wearables, cameras and environmental sensors, the capacity for models that involve multiple humans and finding the synchronies and attunements amongst them under environmental changes. And this is like the work of hyperscanning and Guillaume de Ma and a lot of other people in that field. Thinking about cyber physical systems, like what if the state is inside the head purportedly of a human? Is that different than if this state is purportedly inside of a software? Which ones get to be affect? Which ones get to be what, standing? And then also it helps us and always is important, maybe you'll go here with who and why and how, Dean, but really just all these axes that phenomenology has been addressed from developmental, multicultural, neurodiversity, a lot of historical perspectives, that also is continuing to weave together and not being said to be obsolete or simplified by a computational model. Yeah, if you want to know more phenomenology, go and read some Sean Gallagher. Nice, don't know about that, but sounds cool. Nice, yeah. Anything there or last? Okay, then here was just one paper that kind of came out, just on a closing note, like how it connects out maybe to other areas. This was looking at behaviors across a bunch of different fruit fly species, Drosophila. And then here's the big figure or one of them, kind of mapping, just like you might map genes being correlated or might map neural activations to be correlated across different regions of the brain, those same matrix methods, tensor methods fundamentally, covariance estimation can be used to study different kinds of relationships. So earlier we saw like the neural activity and the behavior. Here, the heat map is like behavior to behavior. They're looking for pure behavioral co-variation. But then what's really cool about this paper is that they use several techniques from information theory, which we see all the time in FEP, information, thermal, cool, going that way. But then also puts it explicitly in a comparative evolutionary framework. So this is really moving towards models that can just very seamlessly integrate different kinds of data as easy as integrating the same kind of data. Just the matrix is type A of data by type B of data rather than type A by type A. So these kinds of models that cross data input types need to be connected to broader traditions like thinking about development and ecology evolution. And it's just also interesting how these fields which are increasingly data rich are gonna be using different cutting edge theoretical frameworks, such as one closing thought about where's evolution in this? Where's development? Where's, what are we doing? All these components that discussion elicits. So, any last thoughts? Otherwise, thanks, Blue and Steven and Dean because this was fun to work on and I think we all got to learn a lot here. Yeah. Definitely not. More tomorrow. Yep, I know, I know. It's only a few, we've just been so not on top. Okay, all right, thank you again. Thanks everyone for watching. Peace out. Bye.