I'm new to signal constellation and trying to understand how M-PAM works. If there is a binary sequence that has on odd number of bits and I want to send a 4-PAM signal, there will be one bit left after encoding a symbol by two bits ($k=2$). For example: the sequence $1001001$ will be encoded as $10\rightarrow3$, $01\rightarrow-1$, $00\rightarrow-3$ and the last bit will be by itself. How do I encode the last bit? What about 16-PAM? Will I need to express the sequence in more bits?
This problem is solved in the upper layers of the communication system, not at the PHY.
For example, in the data link layer (DLL), the transmission unit is a frame. Frames are designed to be compatible with the PHY, so that problems like the one you describe don't occur. Also, many DLL protocols allow for fixed-size frames to be padded, or for variable-size frames, which provide some flexibility.