## 1 Introduction  
Modern wireless communication systems are expected to offer not only better quality of service (QoS) but also software-defined radio for diverse ubiquitous applications [1]. To realize these expectations, (beyond) fifth-generation (5G) mobile telecommunication systems consider the reconfigurable intelligent surface (RIS) as a crucial component for their capability to customize radio frequency (RF) propagation properties, enabling configurable wireless networks [2, 3, 4]. Specifically, the RIS contains a two-dimensional array of discrete elements, whose electromagnetic impedance are individually tunable [5, 6]. This theoretically supports artificial manipulation of signal reflection, diffraction, refraction, polarization, and absorption [7, 8, 9]. Leveraging higher-frequency RF for faster data rates is generally accepted for modern communication networks [10, 11], whereas it results in more severe signal attenuation when there is no line-of-sight (LoS) link between the base station (BS) and the device of interest (DOI) due to weaker diffraction abilities [12, 13]. Therefore, among the mentioned RIS functionalities, controlling the signal reflection properties is the most influential one, since it prevents excessive received signal strength indicator (RSSI) drop by constructing an RIS-assisted link to reflect the incoming signal to the direction towards the DOI in non-line-of-sight (NLoS) areas [14, 15]. RISs achieve this by assigning suitable complex-valued (CV) RIS codewords to specify the beamforming configurations of all RIS elements [16, 17]. Such enhancement particularly promotes research on the localization problems in RIS-enhanced environments. Conventional localization techniques in wireless communication networks utilize time of flight (ToF) [18] and RSSI [19], among other things, to obtain high-accuracy location estimation in different scenarios [20]. However, these methods cannot be directly adopted in RIS-enhanced environments, since the RIS changes original signal propagation properties, inducing wrong inferences of distances or locations. Some related studies proposed sophisticated communication models and utilized 3D geometric information to either directly calculate DOI positions or analyze estimation error bounds [16; 21; 22]. However, all these works require detailed CV channel gains/matrices among BSs and DOIs based on accurate field measurements (e.g., ray tracing and wave optics [8]), which are hardly available in practice. Meanwhile, since multiple-input, multiple-output (MIMO) [23] orthogonal frequency-division multiplexing (OFDM) [24] is an accepted paradigm for modern wireless networks [25], as the numbers of BSs and DOIs increase, these models have to consider more and more data links on all sub-carriers between devices. Hence, the fast-growing complexity of these methods leads to long inference time [26], which severely limits their usability in real-world deployments. Considering these drawbacks, other solutions measure the RSSI from known BSs for data-driven fingerprint-based localization [27; 28; 29; 30] in RIS-enhanced environments [31; 32; 33], as the fingerprints are much easier to collect than field measurements [34] and are far simpler than CV channel matrices [33; 35]. However, these methods usually involve cooperation with optimized RIS codewords to provide high-accuracy localization, which unrealistically assumes that the RIS is solely deployed for localization rather than more pressing demands in modern high-frequency wireless networks, such as enlarging the signal coverage and increasing the overall network throughput [8; 32]. These approaches also share a common disadvantage in that the CV RIS codewords are indispensable during location inference, which means there are huge additional communication burdens when transmitting large CV vectors to DOIs. In RIS-enhanced environments, the fingerprints are affected by not only locations but also codewords.