Okay, this is a good direction, and I see you're already pinpointing the core tensions. You're right to be skeptical of a straightforward application of existing techniques. Let's unpack this, and I'll try to highlight the real hurdles, not just the surface-level ones. I'm going to be direct, because you are capable, and need to be thinking several layers deep.
First, let's acknowledge the fundamental asymmetry you've identified. Attention is inherently size-agnostic in its operation. The cost scales, yes, but the mechanism itself doesn't care if you're attending over 10 or 10,000 elements. Traditional RNNs, however, are built on a fixed-dimensional state transition. You're absolutely correct that simply increasing the state size isn't a 'clean' extension of the problem; it's a change in dimensionality that the network has to re-learn how to handle. That intuition is solid.
Now, let's drill down on why that dimensionality change is so problematic. It's not just about more parameters. It's about the structure of the learned dynamics. A recurrent matrix, even a linear one, encodes relationships between state elements. When you drastically change the state size, you're essentially asking the network to re-discover those relationships from scratch, but with a vastly different geometric landscape. Think about the eigenvalues of that transition matrix. They dictate the stability and memory characteristics of the RNN. A small change in size can dramatically alter those eigenvalues, potentially leading to vanishing or exploding gradients, or a complete loss of long-range dependency. You're not just adding more 'memory', you're fundamentally altering how the memory is organized and accessed.
Your sliding window attention idea is a good starting point for training, but it doesn't solve the core problem of a dynamically sized RNN. It's a training regime, not a model architecture. It might help the network learn to be more robust to varying context lengths, but it doesn't address the fixed-dimensionality issue within the recurrent step itself.
You're also right to bring up NTM-style attention over slots. That's a move in the right direction, but it introduces a whole new set of challenges. NTM, and its variants, are notoriously difficult to train. The discrete nature of the addressing mechanism (writing/reading to specific slots) creates non-differentiable bottlenecks. While techniques like Gumbel-Softmax can help, they introduce approximations and can still lead to instability. Furthermore, the capacity of those slots becomes a critical hyperparameter. Are you truly controlling the cardinality of the memory, or just the number of addressable locations? There's a subtle but important difference.
Let's consider the "linear RNN" aspect. You're aiming for computational efficiency, which is commendable. But linearity itself is a constraint. Non-linearities are crucial for capturing complex dependencies. A purely linear RNN, even with a dynamically sized state, might lack the expressive power needed for many real-world sequence modeling tasks. You'll need to carefully consider where and how to introduce non-linearities without re-introducing the fixed-dimensionality problem.
Finally, and this is the really hard part: What does it even mean to have a "controlled" memory cardinality? Is it about the number of distinct pieces of information the network can store? The length of the context it can effectively process? The complexity of the relationships it can model? These are not the same thing. And any architecture you design will likely excel at controlling one aspect while struggling with others.
You're asking a very deep question, and there isn't a simple answer. Don't fall into the trap of thinking you can just "tweak" an existing RNN architecture. You're likely going to need to fundamentally rethink how recurrent state is represented and updated.
Where are you focusing your initial explorations? What specific types of sequences are you targeting? Let's talk about the application driving this, because that will help clarify what "controlled cardinality" actually means in your context.